diff --git a/src/osgWrappers/osgGA/EventQueue.cpp b/src/osgWrappers/osgGA/EventQueue.cpp index 9963d19c4..f1efeef2d 100644 --- a/src/osgWrappers/osgGA/EventQueue.cpp +++ b/src/osgWrappers/osgGA/EventQueue.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -68,6 +69,11 @@ BEGIN_OBJECT_REFLECTOR(osgGA::EventQueue) __bool__getUseFixedMouseInputRange, "Get whether the mouse coordinates should be transformed into a pre defined input range. ", ""); + I_Method1(void, setGraphicsContext, IN, osg::GraphicsContext *, context, + Properties::NON_VIRTUAL, + __void__setGraphicsContext__osg_GraphicsContext_P1, + "Set the graphics context associated with this event queue. ", + ""); I_Method4(void, setMouseInputRange, IN, float, xMin, IN, float, yMin, IN, float, xMax, IN, float, yMax, Properties::NON_VIRTUAL, __void__setMouseInputRange__float__float__float__float, @@ -274,6 +280,9 @@ BEGIN_OBJECT_REFLECTOR(osgGA::EventQueue) I_SimpleProperty(osgGA::EventQueue::Events &, Events, 0, __void__setEvents__Events_R1); + I_SimpleProperty(osg::GraphicsContext *, GraphicsContext, + 0, + __void__setGraphicsContext__osg_GraphicsContext_P1); I_SimpleProperty(osg::Timer_t, StartTick, __osg_Timer_t__getStartTick, __void__setStartTick__osg_Timer_t); diff --git a/src/osgWrappers/osgGA/GUIEventAdapter.cpp b/src/osgWrappers/osgGA/GUIEventAdapter.cpp index cd6f64289..81c9d9354 100644 --- a/src/osgWrappers/osgGA/GUIEventAdapter.cpp +++ b/src/osgWrappers/osgGA/GUIEventAdapter.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -296,6 +297,16 @@ BEGIN_OBJECT_REFLECTOR(osgGA::GUIEventAdapter) __double__time, "deprecated function for getting time of event. ", ""); + I_Method1(void, setGraphicsContext, IN, osg::GraphicsContext *, context, + Properties::NON_VIRTUAL, + __void__setGraphicsContext__osg_GraphicsContext_P1, + "", + ""); + I_Method0(const osg::GraphicsContext *, getGraphicsContext, + Properties::NON_VIRTUAL, + __C5_osg_GraphicsContext_P1__getGraphicsContext, + "", + ""); I_MethodWithDefaults5(void, setWindowRectangle, IN, int, x, , IN, int, y, , IN, int, width, , IN, int, height, , IN, bool, updateMouseRange, true, Properties::NON_VIRTUAL, __void__setWindowRectangle__int__int__int__int__bool, @@ -519,6 +530,9 @@ BEGIN_OBJECT_REFLECTOR(osgGA::GUIEventAdapter) I_SimpleProperty(osgGA::GUIEventAdapter::EventType, EventType, __EventType__getEventType, __void__setEventType__EventType); + I_SimpleProperty(osg::GraphicsContext *, GraphicsContext, + 0, + __void__setGraphicsContext__osg_GraphicsContext_P1); I_SimpleProperty(bool, Handled, __bool__getHandled, __void__setHandled__bool); diff --git a/src/osgWrappers/osgViewer/ViewerBase.cpp b/src/osgWrappers/osgViewer/ViewerBase.cpp index 3e460376f..341533dac 100644 --- a/src/osgWrappers/osgViewer/ViewerBase.cpp +++ b/src/osgWrappers/osgViewer/ViewerBase.cpp @@ -190,6 +190,16 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgViewer::ViewerBase) __bool__getQuitEventSetsDone, "", "true if the viewer respond to the QUIT_APPLICATION-event "); + I_Method1(void, setReleaseContextAtEndOfFrameHint, IN, bool, hint, + Properties::NON_VIRTUAL, + __void__setReleaseContextAtEndOfFrameHint__bool, + "Hint to tell the renderingTraversals() method whether to call relaseContext() on the last context that was made current by the thread calling renderingTraverals(). ", + "Note, when running multi-threaded viewer no threads will be made current or release current. Setting this hint to false can enable the frame loop to be lazy about calling makeCurrent and releaseContext on each new frame, helping performance. However, if you frame loop is managing multiple graphics context all from the main frame thread then this hint must be left on, otherwise the wrong context could be left active, introducing errors in rendering. "); + I_Method0(bool, getReleaseContextAtEndOfFrameHint, + Properties::NON_VIRTUAL, + __bool__getReleaseContextAtEndOfFrameHint, + "Hint to tell the renderingTraversals() method whether to call relaseContext(). ", + ""); I_Method1(void, setUpdateVisitor, IN, osgUtil::UpdateVisitor *, updateVisitor, Properties::NON_VIRTUAL, __void__setUpdateVisitor__osgUtil_UpdateVisitor_P1, @@ -361,6 +371,9 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgViewer::ViewerBase) I_SimpleProperty(osg::Operation *, RealizeOperation, __osg_Operation_P1__getRealizeOperation, __void__setRealizeOperation__osg_Operation_P1); + I_SimpleProperty(bool, ReleaseContextAtEndOfFrameHint, + __bool__getReleaseContextAtEndOfFrameHint, + __void__setReleaseContextAtEndOfFrameHint__bool); I_SimpleProperty(osg::Stats *, Stats, __osg_Stats_P1__getStats, __void__setStats__osg_Stats_P1);