Sign in to follow this  
gowin32

OpenGL OpenGL rendering context over multiple display settings in Win32

Recommended Posts

Hi, I've been looking for a while for an answer to this question but haven't been able to find any discussion on it. This is all working in the context of Win32. What happens to the display of an OpenGL rendering context when you change display settings? For example, suppose that my current display settings are something with 32-bit color depth. Suppose I create a window, set its pixel format to something with 32-bit color depth, create an OpenGL rendering context and make it current, and have something being displayed in it. Then suppose I make a call to ChangeDisplaySettings and change my display settings to something with 16-bit color depth. In general, what will happen to the display of the rendering context? Is the behaviour unspecified and rather it's best to recreate everything on display settings changes? From reading discussions on similar topics, it seems that the general consensus is that both the window and rendering context should be destroyed and recreated after a display settings change. However, there are never any explanations or references given for this practice, so I don't see why it should be true. The main reason I ask this is because I did a small test where I enumerated the pixel formats of a device context under two different display settings and discovered that both the total count and types of pixel formats were different. This seems to indicate that pixel formats are dependent on display settings. A weird potential situation arises: it may be that I've set the pixel format of a device context to be a pixel format which, under different display settings, is no longer enumerated as a valid pixel format of that same device context. This sounds like a bad situation if I also have a rendering context that was created from that pixel format. I haven't been able to track down any information on this through much reading of the Win32 documentation either. Any help would be greatly appreciated.

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