/* Compile with: gcc bug.c `sdl2-config --cflags --libs` */ #include "SDL.h" static void test_window(void) { SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG); SDL_Window *w = SDL_CreateWindow ("test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 500, 500, SDL_WINDOW_OPENGL); SDL_GLContext ctx = SDL_GL_CreateContext(w); SDL_GL_MakeCurrent(w,ctx); fprintf(stderr,"Move your mouse now to generate some events\n"); SDL_Delay(5000); SDL_PumpEvents(); SDL_GL_DeleteContext(ctx); SDL_DestroyWindow (w); SDL_Quit (); } int main(int argc, char** argv) { test_window (); test_window (); return 0; }