| 66 | | class GraphicsWindowEmbedded : public osgViewer::GraphicsWindow |
| 67 | | { |
| 68 | | public: |
| 69 | | |
| 70 | | GraphicsWindowEmbedded(osg::GraphicsContext::Traits* traits=0) |
| 71 | | { |
| 72 | | _traits = traits; |
| 73 | | |
| 74 | | init(); |
| 75 | | |
| 76 | | if (valid()) |
| 77 | | { |
| 78 | | setState( new osg::State ); |
| 79 | | getState()->setGraphicsContext(this); |
| 80 | | |
| 81 | | if (_traits.valid() && _traits->sharedContext) |
| 82 | | { |
| 83 | | getState()->setContextID( _traits->sharedContext->getState()->getContextID() ); |
| 84 | | incrementContextIDUsageCount( getState()->getContextID() ); |
| 85 | | } |
| 86 | | else |
| 87 | | { |
| 88 | | getState()->setContextID( osg::GraphicsContext::createNewContextID() ); |
| 89 | | } |
| 90 | | } |
| 91 | | } |
| 92 | | |
| 93 | | void init() {} |
| 94 | | |
| 95 | | virtual bool valid() const { return true; } |
| 96 | | virtual bool realizeImplementation() { return true; } |
| 97 | | virtual bool isRealizedImplementation() const { return true; } |
| 98 | | virtual void closeImplementation() {} |
| 99 | | virtual bool makeCurrentImplementation() {} |
| 100 | | virtual bool releaseContextImplementation() {} |
| 101 | | virtual void swapBuffersImplementation() {} |
| 102 | | virtual void grabFocus() {} |
| 103 | | virtual void grabFocusIfPointerInWindow() {} |
| 104 | | }; |
| 105 | | |