[osg-users] Intercepting Windows messages
Trajce Nikolov NICK
trajce.nikolov.nick at gmail.com
Wed Nov 11 08:05:57 PST 2015
Hi Anders,
here is what I do for this on Windows
while (!viewer->done())
{
#if defined(_WIN32)
MSG msg;
if (::PeekMessage(&msg,NULL,0,0,PM_NOREMOVE))
{
::GetMessage(&msg, NULL, 0, 0);
if (wins.size())
{
osgViewer::GraphicsHandleWin32 *hdl =
dynamic_cast<osgViewer::GraphicsHandleWin32*>(wins.at(0));
if(hdl)
{
WNDPROC fWndProc =
(WNDPROC)::GetWindowLongPtr(hdl->getHWND(), GWLP_WNDPROC);
if (fWndProc && hdl->getHWND())
{
::CallWindowProc(fWndProc,hdl->getHWND(),msg.message, msg.wParam,
msg.lParam);
}
}
}
}
#endif
On Wed, Nov 11, 2015 at 4:21 PM, Anders Backman <andersb at cs.umu.se> wrote:
> Hi.
>
> Trying the 3DConnexion SpaceNavigator with OSG. However I would like to
> stay away from VRPN and such dependencies...
>
> I was wondering how to best intercept Windows messages from the
> GraphicsWindowWin32 class.
>
> This class has a virtual method handleNativeWindowingEvent which I would
> like to override to catch custom messages from my device.
>
> Would it be possible to implement a derived class and have that
> instantiated instead of the standard osgViewer::GraphicsWindowWin32 one?
>
> Or is there a different method to listen to the messages:
>
> ( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
>
> Thanks,
> Anders
>
>
>
> --
> __________________________________________
> Anders Backman, HPC2N
> 90187 Umeå University, Sweden
> anders at cs.umu.se http://www.hpc2n.umu.se
> Cell: +46-70-392 64 67
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
--
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151111/30923734/attachment-0003.htm>
More information about the osg-users
mailing list