comparison src/video/SDL_video.c @ 3694:b0a707f589a6

Fixed bug #916 Shutting down the video shuts down the event loop, so don't do that after starting the event loop. :)
author Sam Lantinga <slouken@libsdl.org>
date Sun, 24 Jan 2010 19:47:17 +0000
parents d3f330fc2009
children f6a8be3fefa0
comparison
equal deleted inserted replaced
3693:d3f330fc2009 3694:b0a707f589a6
161 { 161 {
162 SDL_VideoDevice *video; 162 SDL_VideoDevice *video;
163 int index; 163 int index;
164 int i; 164 int i;
165 165
166 /* Check to make sure we don't overwrite '_this' */
167 if (_this != NULL) {
168 SDL_VideoQuit();
169 }
170
166 /* Toggle the event thread flags, based on OS requirements */ 171 /* Toggle the event thread flags, based on OS requirements */
167 #if defined(MUST_THREAD_EVENTS) 172 #if defined(MUST_THREAD_EVENTS)
168 flags |= SDL_INIT_EVENTTHREAD; 173 flags |= SDL_INIT_EVENTTHREAD;
169 #elif defined(CANT_THREAD_EVENTS) 174 #elif defined(CANT_THREAD_EVENTS)
170 if ((flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD) { 175 if ((flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD) {
175 180
176 /* Start the event loop */ 181 /* Start the event loop */
177 if (SDL_StartEventLoop(flags) < 0) { 182 if (SDL_StartEventLoop(flags) < 0) {
178 return -1; 183 return -1;
179 } 184 }
180 /* Check to make sure we don't overwrite '_this' */ 185
181 if (_this != NULL) {
182 SDL_VideoQuit();
183 }
184 /* Select the proper video driver */ 186 /* Select the proper video driver */
185 index = 0; 187 index = 0;
186 video = NULL; 188 video = NULL;
187 if (driver_name == NULL) { 189 if (driver_name == NULL) {
188 driver_name = SDL_getenv("SDL_VIDEODRIVER"); 190 driver_name = SDL_getenv("SDL_VIDEODRIVER");