1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
14/* Note, elements of PixeBufferWin32 have used Producer/RenderSurface_Win32.cpp as both
15 * a guide to use of X11/GLX and copiying directly in the case of setBorder().
16 * These elements are license under OSGPL as above, with Copyright (C) 2001-2004 Don Burns.
19#ifndef OSGVIEWER_PIXELBUFFERWIN32
20#define OSGVIEWER_PIXELBUFFERWIN32 1
22#include <osg/GraphicsContext>
23#include <osgViewer/api/Win32/GraphicsHandleWin32>
28class OSGVIEWER_EXPORT PixelBufferWin32 : public osg::GraphicsContext, public osgViewer::GraphicsHandleWin32
32 PixelBufferWin32(osg::GraphicsContext::Traits* traits);
34 virtual ~PixelBufferWin32();
36 virtual bool isSameKindAs(const Object* object) const { return dynamic_cast<const PixelBufferWin32*>(object)!=0; }
37 virtual const char* libraryName() const { return "osgViewer"; }
38 virtual const char* className() const { return "PixelBufferWin32"; }
40 virtual bool valid() const { return _valid; }
42 /** Realize the GraphicsContext.*/
43 virtual bool realizeImplementation();
45 /** Return true if the graphics context has been realized and is ready to use.*/
46 virtual bool isRealizedImplementation() const { return _realized; }
48 /** Close the graphics context.*/
49 virtual void closeImplementation();
51 /** Make this graphics context current.*/
52 virtual bool makeCurrentImplementation();
53 virtual bool makeContextCurrentImplementation( GraphicsContext* /*readContext*/ );
55 /** Release the graphics context.*/
56 virtual bool releaseContextImplementation();
58 /** Swap the front and back buffers.*/
59 virtual void swapBuffersImplementation();
61 virtual void bindPBufferToTextureImplementation( GLenum /*buffer*/ );