Reputation: 7213
I'm getting a segfault that GDB says is coming from SDL_GL_SwapBuffers. However, I can't imagine why. The SDL documentation mentions no specific pre-conditions for calling swapBuffers except that double buffering be allowed. Is this an option I have to turn on while initializing OpenGL or is this a hardware capability thing?
My code:
(Ignore the unused variables, strange comments and other things. I haven't prettied this up at all. :P)
Upvotes: 1
Views: 1829
Reputation: 22210
Documentation says:
Description
Swap the OpenGL buffers, if double-buffering is supported.
You are using SDL_GL_SwapBuffers()
without enabling double-buffering.
SDL_Surface *screen = SDL_SetVideoMode(800, 600, 32, SDL_DOUBLEBUF | SDL_HWSURFACE);
Upvotes: 3
Reputation: 283644
Why are you mixing gl and SDL calls? Seems like SDL should give you an OpenGL context and make it active, then you could call glSwapBuffers.
Upvotes: 0