My toolbar is covered by my OpenGL scene...
Hi,
I have a CFrameWnd-window in which I render the scene. I added a dockable toolbar but it is not visible in the docked state because my scene is rendered in the whole client area, also over the toolbar. When I click the location of a button in the toolbar, the button appears for one frame and then disapears again.
What I tried doing to solve this problem is to use GL_SCISSOR_TEST to avoid drawing over the docked toolbar.
But it seems that the SwapBuffers(hDC) command swaps the entire client aera and the problem remains.
Any idea how to solve my problem?
Thanks
Not sure what the problem is, but just make sure you WS_VISIBLE when making your toolbar.
"With my feet upon the ground I lose myself between the sounds and open wide to suck it in, I feel it move across my skin. I''m reaching up and reaching out. I''m reaching for the random or what ever will bewilder me, what ever will bewilder me. And following our will and wind we may just go where no one''s been. We''ll ride the spiral to the end and may just go where no one''s been." - Maynard James Keenan Name: TheBlackJester
Team: Wildfire Studios
Projects
O A.D.
The Last Alliance
Thank you,
The WS_VISIBLE flag is set (and if I don''t SwapBuffers(hDC) my toolbar appears and is working fine).
I think it is rather a problem with SwapBuffers(hDC). Could a specify a smaller swapping area than the client area amybe?
The WS_VISIBLE flag is set (and if I don''t SwapBuffers(hDC) my toolbar appears and is working fine).
I think it is rather a problem with SwapBuffers(hDC). Could a specify a smaller swapping area than the client area amybe?
Just found something:
SwapBuffers(GetDCEx(NULL,DCX_CLIPCHILDREN)->m_hDC);
The GetDCEx function allows to exclude the areas occupied by children from the client area.
Also
SwapBuffers(GetDCEx(®ion,DCX_EXCLUDERGN)->m_hDC);
should have the same effect but with a user-defined area.
I tested both, but it seems it has no effect...
SwapBuffers(GetDCEx(NULL,DCX_CLIPCHILDREN)->m_hDC);
The GetDCEx function allows to exclude the areas occupied by children from the client area.
Also
SwapBuffers(GetDCEx(®ion,DCX_EXCLUDERGN)->m_hDC);
should have the same effect but with a user-defined area.
I tested both, but it seems it has no effect...
I found it!
I simply had to specify the WS_CLIPCHILDREN-flag when creating my window!
Now my toolBar is always on top. But the rendering still ''thinks'' it can render onto the whole client area: the top and bottom of my scene is cut by the toolBar and statusBar. Any way to overcome this without using viewports?
I simply had to specify the WS_CLIPCHILDREN-flag when creating my window!
Now my toolBar is always on top. But the rendering still ''thinks'' it can render onto the whole client area: the top and bottom of my scene is cut by the toolBar and statusBar. Any way to overcome this without using viewports?
Look into PreCreateWindow
[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement