• Advertisement
Sign in to follow this  

Windows Game Programming-Subwindows

This topic is 4126 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'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
Advertisement
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
Sign in to follow this  

  • Advertisement