2D, SDL, and OpenGL Help Needed... | | Pete Taylor wrote:
> OK, after the earlier post regarding SDL's slow framerates (not that
> it's *that* slow) I have been looking at OpenGL related stuff on the
> internet. The thing is, I can't seem to find out what files I need to
> start programming with OpenGL, and there seems to be little (if any)
> documentation about how to integrate OpenGL with SDL.
Surely there is an example on the SDL website?
It's been a while since I looked at SDL & OpenGL, but I don't recall it
being that hard.
> Just to do a bit of running before I can walk, do you open a window
> (define/display a surface) with SDL and use OpenGL to write to it?
I beleive that you set up an SDL surface, and use SDL_OPENGL or
something similar as one of the property flags.
> I've been reading about GLU and GLUT, would either of these be better to
> use for programming a 2D game? If I used GLUT, would that render SDL
> obsolete (it looks like you can use it for detecting input etc.)?
I wouldn't. GLUT is intended for a quick utility GUI for openGL, not
for games. I think SDL is the right way to go |