Sign in to follow this  
vurentjie

sdl_set video mode & opengl

Recommended Posts

hi just a query, i am working with sdl mainly to run an opengl screen, what i want to find out is how much do the initial surface settings affect the opengl screen......to be more precise, mywin = SDL_SetVideoMode(500, 500, 0, SDL_OPENGL |SDL_SWSURFACE); if i had to use the above code to call/pass a surface, besides the compulsory SDL_OPENGL to use glfunctions, how much do the other settings affect the gl_window, i am more interested in the use of SDL_SWSURFACE , SDL_HWSURFACE ,for setting where to store memory, i am presuming in different circumstances and architectures one or the other is faster, but would these have any affect once opengl takes over? i am asking merely out of curiosity, since i know that even if there is no sdl double buffer call, once opengl takes over it can have a double buffer depth regardless,....can anyone enlighten me?

Share this post


Link to post
Share on other sites
If you want to create an OpenGL rendering context, the only flag you use is SDL_OPENGL (and optionally SDL_FULLSCREEN if you want a fullscreen window). If you want to control various aspects of your OpenGL window, use SDL_GL_SetAttribute(). For example:

SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

would enable double buffering. You should do all of your SDL_GL_SetAttribute calls before you call SDL_SetVideoMode. Whether or not you get hardware acceleration depends, as you suspected, on your hardware and your video card driver. The flags SDL_SWSURFACE, SDL_HWSURFACE, etc have no use when you set SDL_OPENGL.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this