OpenSceneGraph 3.6.5
GraphicsHandleX11
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
2 *
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.
7 *
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.
12*/
13
14#ifndef OSGVIEWER_GRAPHICSHANDLEX11
15#define OSGVIEWER_GRAPHICSHANDLEX11 1
16
17#include <osgViewer/Export>
18
19
20#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)
21 #define OSG_USE_EGL
22 #include <X11/X.h>
23 #include <X11/Xlib.h>
24 #include <X11/Xutil.h>
25 #include <EGL/egl.h>
26#else
27 #define GLX_GLXEXT_PROTOTYPES 1
28 #include <X11/X.h>
29 #include <X11/Xlib.h>
30 #include <X11/Xutil.h>
31 #include <GL/glx.h>
32 #ifndef GLX_VERSION_1_3
33 typedef XID GLXPbuffer;
34 #endif
35#endif
36
37namespace osgViewer
38{
39
43
45{
46 public:
47
51
53 inline void setDisplay(Display* display) { _display = display; }
54
56 inline Display* getDisplay() const { return _display; }
57
58 #ifdef OSG_USE_EGL
59 typedef EGLContext Context;
60 typedef EGLSurface Pbuffer;
61 #else
62 typedef GLXContext Context;
64 #endif
65
67 inline void setContext(Context context) { _context = context; }
68
70 inline Context getContext() const { return _context; }
71
72 protected:
73
74 Display* _display;
76};
77
78}
79
80#endif
XID GLXPbuffer
Definition GraphicsHandleX11:33
The osgViewer library provides high level viewer functionality designed to make it easier to write a ...
Context getContext() const
Get native OpenGL graphics context.
Definition GraphicsHandleX11:70
void setContext(Context context)
Set native OpenGL graphics context.
Definition GraphicsHandleX11:67
GraphicsHandleX11()
Definition GraphicsHandleX11:48
Context _context
Definition GraphicsHandleX11:75
GLXContext Context
Definition GraphicsHandleX11:62
void setDisplay(Display *display)
Set X11 display.
Definition GraphicsHandleX11:53
Display * _display
Definition GraphicsHandleX11:74
GLXPbuffer Pbuffer
Definition GraphicsHandleX11:63
Display * getDisplay() const
Get X11 display.
Definition GraphicsHandleX11:56
#define OSGVIEWER_EXPORT
Definition Export:40

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.