switching sdl opengl
hello,
is there any info in the sdl docs about switching between sdl and opengl?
or do i actually need this?
basically, say i create an opengl window then at a later stage i want to use sdl to draw(or do something else), could i just use flags for this, or would this hamper the opengl, i haven't tested anything yet so this is just to ask for some advice beforehand,
obviously i would have to be careful that the opengl state doesn't change while doing other sdl stuff, and when opengl gets recalled it is as before.
am i thinking correctly?
At any time, your window can either be an OpenGL context or a SDL based surface. In order to switch between them you would have to call SDL_SetVideoMode again, which would ditch the current OpenGL context or dispose of the current SDL frame buffer.
If you want to have a 2D overlay on OpenGL, you can use something like this to get the correct matrices, then draw what you want. Code to upload a SDL_Surface to an OpenGL texture is provided with the SDL source code (it is in the "test" folder, or was last time I checked).
Here is an example that demonstrates these concepts.
If you want to have a 2D overlay on OpenGL, you can use something like this to get the correct matrices, then draw what you want. Code to upload a SDL_Surface to an OpenGL texture is provided with the SDL source code (it is in the "test" folder, or was last time I checked).
Here is an example that demonstrates these concepts.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement