김명재
unread,Jul 21, 2013, 6:21:14 AM7/21/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vrjuggler...@googlegroups.com
I want to develop osg-based widget library which can be used on vrjuggler.
(It means, library has to be encapsulated very well)
As an example, RectButton class has to be encapsulated properly with various event such as mouseClicked, keyDown, keyUp, mouseOver, and so on(Events are just examples).
But whatever input device is, device input events are received by vrjuggler as long as vrjuggler holds kernel, I can't add any eventhandler on my library because vrjuggler uses SceneView, not Viewer.
(Actually, even if vrjuggler uses Viewer, add eventHandler is manual still)
After some surf, I found AppViewer class and although it uses Viewer, I added this code in bufferPreDraw()
(I'm modifying AdvancedOSGNav example)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
osg::ref_ptr<osgViewer::Viewer> contextViewer;
contextViewer = (*mContextViewer);
contextViewer->addEventHandler(ctrler.get());
contextViewer->getCamera()->setViewMatrixAsLookAt(
osg::Vec3(0.0f, -100.0f, 0.0f), osg::Vec3(), osg::Z_AXIS);
ctrler is an instance of my custom class which inherits GUIEventHandler in which overrides handle() method.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
But it gives this error ->
Warning: detected OpenGL error 'invalid value' at after RenderBin::draw(..)
I can still see cow.osg model and vrjuggler keys(which are defined in standalone.jconf file) are still working.
But it seems like code doesn't come into overrided handle() method because I toggled breakpoint in it, but code doesn't stop when debugging.
All other code are not modified from original one except upper code.
My questions are
1. What is the problem with my situation? (Viewer case [vrj::osg::AppViewer)
2. Is there any good idea to make well-encapsulated and event-handled widget library (like .net, MFC, QT etc.) in this vrjuggler+OSG system using SceneView (vrj::osg::App)?
Thank you in advanced.