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:
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.
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).