Removed completely non-portable event thread hack.

Next I'll be working on generalizing the event sources and making the event queue lock-free. :)
This commit is contained in:
Sam Lantinga 2011-01-27 22:44:08 -08:00
parent 95dbe47cf3
commit c3daf0f0cd
16 changed files with 44 additions and 227 deletions

View file

@ -616,7 +616,7 @@ CommonInit(CommonState * state)
fprintf(stderr, "\n");
}
}
if (SDL_VideoInit(state->videodriver, 0) < 0) {
if (SDL_VideoInit(state->videodriver) < 0) {
fprintf(stderr, "Couldn't initialize video driver: %s\n",
SDL_GetError());
return SDL_FALSE;

View file

@ -60,7 +60,7 @@ int main(int argc,char** argv) {
exit(-1);
}
if(SDL_VideoInit(NULL,0) == -1) {
if(SDL_VideoInit(NULL) == -1) {
printf("Could not initialize SDL video.\n");
exit(-2);
}

View file

@ -241,16 +241,7 @@ main(int argc, char *argv[])
video_flags = SDL_SWSURFACE;
parsed = 1;
while (parsed) {
/* If the threaded option is enabled, and the SDL library hasn't
been compiled with threaded events enabled, then the mouse and
keyboard won't respond.
*/
if ((argc >= 2) && (strcmp(argv[1], "-threaded") == 0)) {
init_flags |= SDL_INIT_EVENTTHREAD;
argc -= 1;
argv += 1;
printf("Running with threaded events\n");
} else if ((argc >= 2) && (strcmp(argv[1], "-fullscreen") == 0)) {
if ((argc >= 2) && (strcmp(argv[1], "-fullscreen") == 0)) {
video_flags |= SDL_FULLSCREEN;
argc -= 1;
argv += 1;
@ -320,9 +311,8 @@ main(int argc, char *argv[])
/* Loop, waiting for QUIT */
while (!done) {
if (!(init_flags & SDL_INIT_EVENTTHREAD)) {
SDL_PumpEvents(); /* Needed when event thread is off */
}
SDL_PumpEvents();
if (SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, SDL_QUIT, SDL_QUIT)) {
done = 1;
}