GraphicsHandleX11
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGVIEWER_GRAPHICSHANDLEX11
#define OSGVIEWER_GRAPHICSHANDLEX11 1
#include <osgViewer/Export>
#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)
#define OSG_USE_EGL
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <EGL/egl.h>
#else
#define GLX_GLXEXT_PROTOTYPES 1
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/glx.h>
#ifndef GLX_VERSION_1_3
typedef XID GLXPbuffer;
#endif
#endif
namespace osgViewer
{
class OSGVIEWER_EXPORT GraphicsHandleX11
{
public:
GraphicsHandleX11():
_display(0),
_context(0) {}
inline void setDisplay(Display* display) { _display = display; }
inline Display* getDisplay() const { return _display; }
#ifdef OSG_USE_EGL
typedef EGLContext Context;
typedef EGLSurface Pbuffer;
#else
typedef GLXContext Context;
typedef GLXPbuffer Pbuffer;
#endif
inline void setContext(Context context) { _context = context; }
inline Context getContext() const { return _context; }
protected:
Display* _display;
Context _context;
};
}
#endif
GLXPbuffer
XID GLXPbuffer
Definition GraphicsHandleX11:33
osgViewer::GraphicsHandleX11::getContext
Context getContext() const
Definition GraphicsHandleX11:70
osgViewer::GraphicsHandleX11::setContext
void setContext(Context context)
Definition GraphicsHandleX11:67
osgViewer::GraphicsHandleX11::GraphicsHandleX11
GraphicsHandleX11()
Definition GraphicsHandleX11:48
osgViewer::GraphicsHandleX11::_context
Context _context
Definition GraphicsHandleX11:75
osgViewer::GraphicsHandleX11::Context
GLXContext Context
Definition GraphicsHandleX11:62
osgViewer::GraphicsHandleX11::setDisplay
void setDisplay(Display *display)
Definition GraphicsHandleX11:53
osgViewer::GraphicsHandleX11::_display
Display * _display
Definition GraphicsHandleX11:74
osgViewer::GraphicsHandleX11::Pbuffer
GLXPbuffer Pbuffer
Definition GraphicsHandleX11:63
osgViewer::GraphicsHandleX11::getDisplay
Display * getDisplay() const
Definition GraphicsHandleX11:56
osgViewer
Export
OSGVIEWER_EXPORT
#define OSGVIEWER_EXPORT
Definition osgViewer/Export:40