Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenGL using SDL Tutorials?

Started by Sylveste Jan 15, 2006 at 5:46 PM 4 replies 1.2k views
Original Post
Sylveste
Sylveste
There is a lot of information about OpenGL on the net, but they always start with, and are based on something like windows programming. I really don't care about any OS specific programming stuff because I have taught myself SDL. Are there any OpenGL tutorials/articles that concern using it with SDL?
SiCrane
SiCrane
Most of the tutorials at NeHe contain SDL ports.
rip-off
rip-off
Quote:
Original post by Sylveste
There is a lot of information about OpenGL on the net,
but they always start with, and are based on
something like windows programming.

I really don't care about any OS specific programming stuff
because I have taught myself SDL.

Are there any OpenGL tutorials/articles
that concern using it with SDL?


well. not really. theres only one thing that differs from other opengl tutorials: the screen setup.

instead of os specific stuff, you have this:

SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8 );SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 24 );SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );    SDL_Surface *screen = SDL_SetVideoMode( 800, 600, 32, SDL_OPENGL);


after that, all open gl stuff is the same...

and you can still use sdl for stuff( like loading textures ), provided you dont try to blit to or read from the screen...
Ezbez
Ezbez
You'll obviously also need to replace the keyboard/mouse controls with SDL code, but you should be able to do that.
Sylveste
Sylveste
I found this:
http://davw.nfshost.com/opengl.php

Just thought I'd post it here in case someone else
is looking for the same thing.

Thanks for everyone who replied!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.