[osg-users] how to suspend rendering context thread
jakob.ruhe at gmail.com
Thu Nov 26 01:43:37 PST 2009
Your question fits better in a forum for MFC or Windows programming.
You can use the Win32 API function GetForegroundWindow to see which
window has the focus or you can use GetWindowPlacement to get the
state about a specific window.
You should also consider using "on-demand rendering" mode in OSG to
reduce the CPU usage. Search for it in this mailing list or visit the
OSG blog to see what it is. Good luck!
2009/11/25 forest <forest37 at 163.com>:
> hi all,
> When I use osgMFCViewer, I create multiple rendering context,that's
> to say there are many HWND, each HWND is related to one Render thread ,so
> much CPU resource is taken up. This is what I want to do: When one viewport
> is maximazed, the others will be hidden ,so these hidden context do not need
> continue the rendering. I want to suspend and resume some rendering thread
> depends on message CWnd::OnSize(UINT nType, int cx, int cy ). I checked
> the MSDN and find that the parameter nType can be one of the following
> SIZE_MAXIMIZED Window has been maximized.
> SIZE_MINIMIZED Window has been minimized.
> SIZE_RESTORED Window has been resized, but neither SIZE_MINIMIZED nor
> SIZE_MAXIMIZED applies.
> SIZE_MAXHIDE Message is sent to all pop-up windows when some other window
> is maximized.
> SIZE_MAXSHOW Message is sent to all pop-up windows when some other window
> has been restored to its former size.
> My problem is that I never get SIZE_MAXHIDE or SIZE_MAXSHOW message.
> Is there anyone who has used SIZE_MAXHIDE or SIZE_MAXSHOW message? Or is
> there any other way to reduce the CPU resource usage？
> thanks in advance
> best regards
> osg-users mailing list
> osg-users at lists.openscenegraph.org
More information about the osg-users