-
Z-order: keeping an openGL window on top
I have 2 openGL windows, among many other windows, in my C++ application.
These 2 openGL windows, we'll call BIG, and SMALL. I've positioned SMALL window over the BIG window. I'd like the SMALL window to NEVER hide behind the BIG window. NEVER. NEVER. NEVER. Of course, anytime I put the cursor in the BIG window, for example to rotate the model in the BIG window, the SMALL window hides behind the big window.
Is there any way to prevent this from happening, so that SMALL ALWAYS stays in front of BIG, even when BIG is the active window.
Thanks.
-
Re: Z-order: keeping an openGL window on top
this is an OS specific question and it really isnt related to OpenGL at all..
edit: I see you are using win32 api.. so you can at least post this post into OpenGL under Windows section .. however you would probably receive the best answers in some forum directly related to win32 programming ( or by using google
)
Try function SetWindowPos ..it can change z-order of the windows
-
Re: Z-order: keeping an openGL window on top
Yeah. I've been fiddling with SetWindowPos, but the moment the BIG window becomes active (like by clicking around inside it), the SMALL window goes behind the BIG window, and thus becomes hidden. I'll try your suggestion of posting to a windows forum. Thanks for your help.
-
Re: Z-order: keeping an openGL window on top
I found the solution, for anyone interested. To make the SMALL window, (which is located over the BIG window), I call ptrSmallWnd->BringWindowToTop() from the BIG window's DrawScene(). Thus, each time the BIG window is done drawing itself, the SMALL window moves to the top of the Z order, so it's visible again.
-
Advanced Member
Frequent Contributor
Re: Z-order: keeping an openGL window on top
So why don't you merge the two windows, you can render the smaller window within the bigger one, it's a much nicer solution.
NeHe lesson 42 deals with multiple viewports.
-
Advanced Member
Frequent Contributor
Re: Z-order: keeping an openGL window on top
Create the smaller window as a child of the "BIG" window.
-
Re: Z-order: keeping an openGL window on top
rgpc, thanks for the suggestion. would making the SMALL window a child of the BIG window keep the SMALL window from getting pushed under the BIG window, in the Z order?
-
Re: Z-order: keeping an openGL window on top
zeoverlord, I'm going to look into the multiple viewports idea. thanks. Having not done that before, I figured it was trickier than simply creating 2 separate windows (BIG and SMALL), and placing one on top of the other.
-
Re: Z-order: keeping an openGL window on top
Just create the small window with the WS_POPOP style, and it will float above all the other non-popup windows. WS_POPUP is often used for modal windows so they stay on top, but you can use the style for non-modal windows too.
-
Re: Z-order: keeping an openGL window on top
gstrickler, I tried making the window style WS_POPUP, but alas, the SMALL window still hides behind the BIG window, each time the BIG window is clicked. Darn.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules