Changed the return types of makeCurrent to bool, and added a bool GraphicsContext::releaseContext method

along with implementations in osgViewer.
This commit is contained in:
Robert Osfield
2007-01-08 19:29:59 +00:00
parent 4a5eda6522
commit 16d1c00a3d
18 changed files with 221 additions and 126 deletions

View File

@@ -74,15 +74,18 @@ class OSGVIEWER_EXPORT GraphicsWindow : public osg::GraphicsContext, public osgG
/** Make this graphics context current implementation.
* Pure virtual - must be implemented by concrate implementations of GraphicsContext. */
virtual void makeCurrentImplementation() { osg::notify(osg::NOTICE)<<"GraphicsWindow::makeCurrentImplementation() not implemented."<<std::endl; }
virtual bool makeCurrentImplementation() { osg::notify(osg::NOTICE)<<"GraphicsWindow::makeCurrentImplementation() not implemented."<<std::endl; return false;}
/** Make this graphics context current with specified read context implementation.
* Pure virtual - must be implemented by concrate implementations of GraphicsContext. */
virtual void makeContextCurrentImplementation(GraphicsContext* /*readContext*/) { osg::notify(osg::NOTICE)<<"GraphicsWindow::makeContextCurrentImplementation(..) not implemented."<<std::endl; }
virtual bool makeContextCurrentImplementation(GraphicsContext* /*readContext*/) { osg::notify(osg::NOTICE)<<"GraphicsWindow::makeContextCurrentImplementation(..) not implemented."<<std::endl; return false;}
/** Release the graphics context.*/
virtual bool releaseContextImplementation() { osg::notify(osg::NOTICE)<<"GraphicsWindow::releaseContextImplementation(..) not implemented."<<std::endl; return false; }
/** Pure virtual, Bind the graphics context to associated texture implementation.
* Pure virtual - must be implemented by concrate implementations of GraphicsContext. */
virtual void bindPBufferToTextureImplementation(GLenum /*buffer*/) { osg::notify(osg::NOTICE)<<"GraphicsWindow::void bindPBufferToTextureImplementation(..) not implemented."<<std::endl; }
virtual void bindPBufferToTextureImplementation(GLenum /*buffer*/) { osg::notify(osg::NOTICE)<<"GraphicsWindow::bindPBufferToTextureImplementation(..) not implemented."<<std::endl; }
/** Swap the front and back buffers implementation.
* Pure virtual - must be implemented by Concrate implementations of GraphicsContext. */

View File

@@ -56,7 +56,10 @@ class GraphicsWindowCocoa : public osgViewer::GraphicsWindow
virtual void closeImplementation();
/** Make this graphics context current.*/
virtual void makeCurrentImplementation();
virtual bool makeCurrentImplementation();
/** Release the graphics context.*/
virtual bool releaseContextImplementation();
/** Swap the front and back buffers.*/
virtual void swapBuffersImplementation();

View File

@@ -56,7 +56,10 @@ class GraphicsWindowWin32 : public osgViewer::GraphicsWindow
virtual void closeImplementation();
/** Make this graphics context current.*/
virtual void makeCurrentImplementation();
virtual bool makeCurrentImplementation();
/** Release the graphics context.*/
virtual bool releaseContextImplementation();
/** Swap the front and back buffers.*/
virtual void swapBuffersImplementation();

View File

@@ -70,7 +70,10 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow
virtual void closeImplementation();
/** Make this graphics context current.*/
virtual void makeCurrentImplementation();
virtual bool makeCurrentImplementation();
/** Release the graphics context.*/
virtual bool releaseContextImplementation();
/** Swap the front and back buffers.*/
virtual void swapBuffersImplementation();