Problem with SDL + OpenGL

Pages: 12
closed account (N36fSL3A)
It is. If not I don't see what's wrong with my function
At least 3 solutions have been posted so far, and the problem has been explained.

This tutorial you're using obviously isn't doing a very good job of teaching you what's going on. Again I must highly recommend you abandon it and go for a better one... like this one:

http://www.arcsynthesis.org/gltut/
closed account (N36fSL3A)
But it doesn't use SDL.
Yeah but you're only interested in the OpenGL portion.

So use the SDL calls to set up your window (which I assume you already know how to do), then use that tutorial as an OpenGL guide. You can ignore the FreeGlut stuff.

That's what I did. Except I used SFML instead of SDL.
Last edited on
closed account (N36fSL3A)
I really don't know how. Is there a tutorial on sdl commands?
If you're using OpenGL... you won't be using SDL commands. At least not for graphics. Instead... you'll be using OpenGL commands.

Fredbill30 wrote:
I know SDL quite well, I'm moving on to opengl.
Fredbill30 wrote:
Is there a tutorial on sdl commands?


? =P

Anyway... using OpenGL with SDL involves the following:

1) You create your SDL window (SDL_SetVideoMode) with the SDL_OPENGL flag.
2) Do all of your drawing with OpenGL commands. Do absolutely nothing graphic related with SDL.
3) Once you're done drawing, call SDL_GL_SwapBuffers() to put what you've drawn on the screen.


That's it. It's exactly the same as what you're already doing... only the OpenGL calls will be different (you will not call glBegin/glMatrixMode/glVertex/etc).
closed account (N36fSL3A)
Oh, I was thinking there were more window commands that SDL required for OpenGL. Silly me :P
Topic archived. No new replies allowed.
Pages: 12