If I use SDL_RESIZABLE together with OpenGL, after resizing the window, all my textures would disappear.
Is that normal? And if so, should I reload it again after resizing?
If I use SDL_RESIZABLE together with OpenGL, after resizing the window, all my textures would disappear.
Is that normal? And if so, should I reload it again after resizing?
If the OpenGL context is lost, the textures and such will be lost. I don't know much about the SDL, but I suppose it's possible that it's dropping context when resizing for some reason. Which still seems like odd behavior to me, so it could be something else entirely too .
M.Eng Computer Engineering CandidateB.Sc Computer Science
Robotics and graphics enthusiast.
I seem to recall soething about having to acquire a new instance after resizing, but I could be wrong. I havent worked too much with OpenGL in years.
You have to call SDL_SetVideoMode() when you receive an SDL_VIDEORESIZE event. This is as true when you're not using OpenGL as when you are.
Just make sure you pass the new window size to SDL_SetVideoMode(), unless you want different behaviour for some reason.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.