Hi Marco,
> But how do I get a HWND of the viewer?
if (_viewer.valid())
{
osgViewer::CompositeViewer::Windows wins;
_viewer->getWindows(wins);
#ifdef WIN32
if (wins.size())
{
osgViewer::GraphicsHandleWin32 *hdl =
dynamic_cast<osgViewer::GraphicsHandleWin32*>(wins.at(0));
if(hdl)
{
MSG* message = (MSG*)msg;
WNDPROC fWndProc = (WNDPROC)::GetWindowLongPtr(hdl->getHWND(),
GWLP_WNDPROC);
fWndProc(hdl->getHWND(), message->message, message->wParam,
message->lParam);
}
}
#endif
}
you have to construct your MSG message .. this is a snippet from my app
Hope it helps
Nick
On Mon, Jun 2, 2014 at 11:32 AM, Marco Kliko <[email protected]>
wrote:
>
> Trajce Nikolov NICK wrote:
> > Hi
> >
> >
> >
> > > So when the window is not visible, I would prefer to pause the
> rendering of the model instead of destroying it.
> > >
> >
> >
> > You can control the rendering loop by calling viewer->frame() whenever
> you need. In some sort of similar application in the past I used timer to
> render the frame and when not needed I killed the timer and reset when
> needed again. If you are under windows you can send messages like
> WM_SHOW/WM_HIDE directly to your HWND or set the windows style WS_VISIBLE,
> that how I controlled the visibility of the window
> >
> >
> > Nick
> >
>
>
> Hi Nick,
>
> Thanks for your reaction. I want to try the WM_SHOW/WM_HIDE thingy.
> But how do I get a HWND of the viewer?
>
> I have found a website where they create a osg-window with an window
> handle.
>
> http://my.safaribooksonline.com/book/animation-and-3d/9781849512824/interacting-with-outside-elements/ch09lvl1sec13
> But I don't understand it completely. I believe parts of the code are
> missing. Am I correct?
> I see the point to read it all and writing your own code instead of just
> copying it. But I am not experienced with window handles and I am having
> trouble seeing the "big picture" here.
>
> Can somebody help me with this?
>
> Thanks in advance!
>
> Marco
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=59618#59618
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
--
trajce nikolov nick
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org