AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
EglContext.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
20
21#if AGX_USE_EGL()
22
23#include <EGL/egl.h>
24#include <EGL/eglext.h>
25
26#undef Status
27#undef Bool
28#undef Convex
29
30
32#include <osg/GraphicsContext>
34
35namespace agxOSG
36{
37
50 class EglContext : public osg::GraphicsContext
51 {
52 public:
53 EglContext(osg::GraphicsContext::Traits* traits);
54
55 virtual bool isSameKindAs(const Object* object) const;
56
57 virtual const char* libraryName() const;
58 virtual const char* className() const;
59
60 virtual bool valid() const;
61
63 virtual bool realizeImplementation();
64
66 virtual bool isRealizedImplementation() const;
67
69 virtual void closeImplementation();
70
72 virtual bool makeCurrentImplementation();
73
75 virtual bool makeContextCurrentImplementation(osg::GraphicsContext* readContext);
76
78 virtual bool releaseContextImplementation();
79
81 virtual void bindPBufferToTextureImplementation(GLenum buffer);
82
84 virtual void swapBuffersImplementation();
85
86 protected:
87 ~EglContext();
88
89 void init();
90
91 void queryDevices();
92 EGLDisplay getDisplayFromDevice( EGLDeviceEXT dev );
93
94 EGLSurface m_eglSurface;
95 EGLDisplay m_eglDisplay;
96 EGLContext m_eglContext;
97
98 EGLDeviceEXT* m_eglDevices;
99
100 agx::Int32 m_numDevices;
101
102 bool m_valid;
103 bool m_initialized;
104 bool m_realized;
105
106 };
107
108}
109
110#endif
111
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
int32_t Int32
Definition: Integer.h:37
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.