Archived

This topic is now archived and is closed to further replies.

OpenGL Textures with SDL_RESIZABLE

This topic is 4980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When using a video mode with the SDL_RESIZABLE flag, upon resizing, all of my OpenGL texture resources "seem" to be lost. The symptom displayed is that all of my textured polygons are now pure white. Now I''ve looked at the SDL versions of some of NeHe''s tutorials, and have run them to see if they share the same problem, which they do. They do not account for resource loss during a window resize. Now I haven''t found any documentation on the matter at the main SDL site, nor anywhere else. The problem seems to be ignored, otherwise I figure the SDL-port of NeHe lesson#6 would have code to restore the textures upon resize. What I''m wondering is, is this texture loss only happening to me? Is that why nobody else seems to talk about it? It does seem rather odd that a simple window resize would cause a loss of textures... The loss doesn''t even occur during minimization/maximization. "Don''t be afraid to dream, for out of such fragile things come miracles."

Share this post


Link to post
Share on other sites
Well... something strange is definitely going on. Perhaps it''s not a resource loss exactly. I tried reloading all the textures after the resize event occurs, yet they''re still all white. Can anybody shed some light on this matter?

"Don''t be afraid to dream, for out of such fragile things come miracles."

Share this post


Link to post
Share on other sites
Well, I seem to have solved the problem. Apparently the entire OpenGL state is lost every time you make a call to SDL_SetVideoMode(). Thanks for the help!

"Don''t be afraid to dream, for out of such fragile things come miracles."

Share this post


Link to post
Share on other sites
i thought this problem was only for windows machines. is it doing it on linux as well?

my barrel patrol game had this problem, so i added a "refresh textures" function that would go in and reload textures when i needed to. work fine. not only are the textures lost, but the handles are too. basically, you''ve got a whole new openGL state, i believe -- all handles are lost (vbo, textures, display lists, etc.). or at least, i believe they are.

my current geometry editor app works fine if i just don''t call setvideomode on a resize event. i''m not chanhing bit depths or anything, so i just leave it alone. the mouse coordinates are clipped to the initial size of the window, but if i open a window at the max screen size, that''s not a problem. dunno how portable this solution is, but it works for my radeon 9700 and windows 2k...

Share this post


Link to post
Share on other sites
quote:
Original post by Syphoon
Is there a solution for this? Because this is making SDL a pretty horrible option at the moment for Linux rendering on our engine at the moment...


I don''t know if I''d go that far - resizing a windows is something I never do in a game, like most people I run it fullscreen. But its'' a PITA and bugs me because I like neat code that works and this is everything but >

Share this post


Link to post
Share on other sites