Sign in to follow this  
lost_wolf

OpenGL OpenGL Context

Recommended Posts

So, I'm getting tired of window wrappers like SDL causing the reloading of the OpenGL context every time something about the size or state of a screen changes. I've looked at source code for various wrappers and code without wrappers and it seems that OpenGL contexts only need to be reloaded when the pixel depth of a window is changed (if even then...) Was just wondering if anyone else could confirm this. Also was wondering if anyone knew of or has made an opengl context manager that works up to current opengl. I've made a basic one, consider it a waste seeing as opengl has a context instance somewhere that I would rather access and copy to reduce reload time of opengl when changing pixel depth. Appretiate any insight, LostWolf

Share this post


Link to post
Share on other sites
Quote:
Original post by lost_wolf
So, I'm getting tired of window wrappers like SDL causing the reloading of the OpenGL context every time something about the size or state of a screen changes.

Do they still have this bug in SDL after so many years ? Unbelievable.

Quote:
Original post by lost_wolf
I've looked at source code for various wrappers and code without wrappers and it seems that OpenGL contexts only need to be reloaded when the pixel depth of a window is changed (if even then...)

Well, officially you have to create a new context when you change the bitdepth of a bitplane (colour, depth, stencil, accum, etc) on the rendering window. But there are ways around that. Although in practice, you will rarely change them on the fly. And of course, you need separate contexts if you multithread OGL calls, which is a bad idea™ anyway.

Size, however, doesn't require you to touch the context at all.

Quote:
Original post by lost_wolf
Was just wondering if anyone else could confirm this. Also was wondering if anyone knew of or has made an opengl context manager that works up to current opengl. I've made a basic one, consider it a waste seeing as opengl has a context instance somewhere that I would rather access and copy to reduce reload time of opengl when changing pixel depth.

I don't really see a need for a "context manager", unless you multithread OGL (see above). There's no real reason to switch colour depth on a modern 3D application or game. Just use the bit depth of the Windows desktop as default. Who still uses 16bit mode anyway ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this