Sign in to follow this  
ryanLawrence

Windows Game Programming-Subwindows

Recommended Posts

I'm trying to add several subwindows to my program to give multiple viewing perspectives and a prompt to display information. Working off of Nehe #42, I got the subwindows working fine, but when I try to change the background color for each subwindow, the entire window's color is changed including the color of the subwindows. I'm lost and tried everything. Please help!

Share this post


Link to post
Share on other sites
I haven't used plain ol' Win32 for a while, but my gut feeling is that your windows are sharing a window class (possibly the className member of the WNDCLASS is the same). Check that first...

Share this post


Link to post
Share on other sites
I'd agree. It sounds like all your windows are sharing the same WndProc, so the same code is being run for each one on the WM_PAINT event.

If that is the case, you need to either register seperate window classes for each sub-window, assign a new WndProc to each subwindow with SetWindowLongPtr or identify the window in the paint procedure and perform different actions based upon this.

However, you have mentioned NeHe and I know nothing about OpenGL so I may be rambling nonsense.

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