I have a project in the works with OpenGL and SDL. Users have the option of using a full-screen or windowed mode for the display.
I use SDL_SetVideoMode
to set up the window, but this solution destroys the original SDL_Su开发者_C百科rface
context (so all my OpenGL textures get cleaned too).
How can I correctly switch between full-screen and windowed mode without textures cleaning?
You need to reload all your textures unfortunately. This is neccesary because SDL recreates the context. It's an SDL issue that is planned to be fixed someday.
More info here.
精彩评论