I have an application that uses GTK + to display some nice GUI, but I use SDL to display a small RGB frame buffer inside GTK +
I used the following code to get SDL in GTK +:
char SDL_windowhack[32]; sprintf(SDL_windowhack, "SDL_WINDOWID=%ld", GDK_WINDOW_XWINDOW(deviceWindow->window)); putenv(SDL_windowhack);
Unfortunately, I also use SDL for keyboard and mouse events. The main thread that uses the SDL to update the image spawns the following stream:
void *SDLEvent(void *arg) { SDL_Event event; while (1) { fprintf(stderr, "Test\n"); SDL_WaitEvent(&event); switch (event.type) { } } }
I see that the print statement is executed twice, and then not. As soon as I complete the thread that uses the SDL to update the screen, the cycle in SDLEvent starts to run very fast again.
This code worked fine before I included SDL in GTK +, so I think GTK + might somehow block SDL?
Does anyone have any suggestions?
Thank you very much!
source share