Jump to content
  • Advertisement

Archived

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

marijnh

OpenGL SDL (+ openGL) - some troubles

This topic is 5362 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

I''ve been using SDL for the platform-specific things in my openGL apps for a while, works fine so far. But recently i wanted to do some more "advanced", polishing stuff and i ran into trouble. Two things: - I want to be able to query for suppored resolution/ colordepth/ z-depth/ stencil-depth/ etc combinations. SDL supports listing supported resolutions for a given color depth, but i could not find a way to indicate z-depth and such in that method. Is there a workaround or extension or something for this? - When my (full screen) applications gets minimized (in win32, did not test on any other OS-es yet) i seem to lose my GL context. When the window gets restored nothing gets drawn anymore (can be fixed by doing a new SDL_SetDisplayMode after the window gets restored). What is up with that? When i write a plain-win32 ogl application this does not happen. A related note: Has anybody ever considered making a kind of minimal SDL version with all the 2d-graphics stuff (which is obsolete when you just need the GL window) stripped out? And the interface cleaned up? And maybe adding a more C++-friendly wrapper? I might put some effort into this myself but i''d have to study the SDL code some more to get an idea of just how much work this would be. Marijn

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by marijnh
- When my (full screen) applications gets minimized (in win32, did not test on any other OS-es yet) i seem to lose my GL context. When the window gets restored nothing gets drawn anymore (can be fixed by doing a new SDL_SetDisplayMode after the window gets restored). What is up with that? When i write a plain-win32 ogl application this does not happen.


on X11/gnome you can minimize and maximize a sdl-ogl fullscreen window without problems O_o
quote:
Original post by marijnh
A related note: Has anybody ever considered making a kind of minimal SDL version with all the 2d-graphics stuff (which is obsolete when you just need the GL window) stripped out? And the interface cleaned up? And maybe adding a more C++-friendly wrapper? I might put some effort into this myself but i''d have to study the SDL code some more to get an idea of just how much work this would be.

Marijn

i wrote a gui system that uses opengl... it appeared more usefull for me to render it than to use the SDL windowing toolkit(<- "SDL windowing toolkit" like in "java abstract windowing toolkit").
I think there are also C++ bindings for SDL... maybe they are just called SDL--, like gtk--...

Share this post


Link to post
Share on other sites
It seems that SDL automatically changes the resolution you supply it if it is not supported, so i guess that takes care of most of my first problem (though not very elegantly). I should have read the whole documentation.

Still no luck solving the openGL-stops-working-on-minimize thing though.

Share this post


Link to post
Share on other sites
Heh, I was having the same problem earlier when switching from fullscreen to windowed and vice-versa. Apparently it's some issue with Windows: http://www.libsdl.org/pipermail/sdl/2003-March/053057.html

D:





[edited by - PsYcHoPrOg on November 12, 2003 8:00:39 PM]

Share this post


Link to post
Share on other sites
Yeah, windows loses the opengl context on resolution change. You have to re-initialize SDL video and reupload all the textures etc. Perhaps glut (if that''s what you''ve used before SDL) takes care of it automatically.

Btw I wouldn''t say that "2d stuff" is obsolete since you''ll probably use SDL surfaces to load and manipulate textures. (And that''s about the extent of graphics routines in SDL anyway, it''s not like it has actual 2d rasterizing functions)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!