Sign in to follow this  
BuffaloJ

OpenGL fullscreen problem

Recommended Posts

I am adding OpenGL fullscreen Windows support to an MFC app(I know it's old) and I ran into a problem when switching from fullscreen back to windowed mode. After going back to windowed mode, the first frame drawn is in the client area of the window as it should be but looks like garbage(the colors seem to match with what I am drawing normally but it is jumbled about). On the second and future frames, it still looks like garbage but also draws over toolbars and a dockable MFC panel I have in there. It works fine for me at home and at work with 1 monitor enabled. It only fails with dual monitor enabled(and probably more that 2 monitors). In a nutshell, when my renderer switches to fullscreen I: - choose the appropriate DEVMODE - ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN) - Create a window to handle the fullscreen mode - add a render context for the new window and make it current - show the window - render this works fine. I got most of this method off a NEHE tutorial. to switch from fullscreen to windowed I: - ChangeDisplaySettings(NULL,0); - Make the original render context current - destroy the fullscreen window - render as usual any insight 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