Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoGLGlew.h
Go to the documentation of this file.
1#if !defined(SOGLGLEW_H)
2#define SOGLGLEW_H 1
3
4#include <Inventor/sys/port.h>
5#include <Inventor/SbBase.h>
7
8#if defined(_WIN32)
9# ifndef InventorGLEW_EXPORTS
10# ifndef OIV_DISABLE_AUTOLINK
11# pragma comment(lib,__INVENTORGLEWLIB)
12# endif
13# endif
14#endif
15
16#ifdef InventorGLEW_EXPORTS
17# define INVENTORGLEW_API VC_DLL_EXPORT
18#else
19# define INVENTORGLEW_API VC_DLL_IMPORT
20#endif
21
22#if defined(OIV_HEADLESS)
23#define glewGetContextNative eglewGetContext
24#elif defined(_WIN32)
25#define glewGetContextNative wglewGetContext
26#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
27#define glewGetContextNative glxewGetContext
28#else
29#define glewGetContextNative glewGetContextMac
30#endif
31
33namespace SoEGLEW
34{
35 struct EGLEWContextStruct;
36}
37
38namespace SoGLXEW
39{
40 struct GLXEWContextStruct;
41}
45{
46public:
47
48#if defined(OIV_HEADLESS)
49 typedef struct SoEGLEW::EGLEWContextStruct GlewContextNative;
50#elif defined(_WIN32)
51 typedef struct WGLEWContextStruct GlewContextNative;
52#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
53 typedef struct SoGLXEW::GLXEWContextStruct GlewContextNative;
54#else
55 typedef struct GLEWContextStruct GlewContextNative;
56#endif
59
60 // GLEWContext associated to this rendering context.
61 struct GLEWContextStruct* m_glewContext;
62 GlewContextNative* m_glewContextNative;
63
65
66 // These methods return a pointer to the GLEWContext associated to this context.
67 struct GLEWContextStruct* glewGetContextIV() const
68 { return m_glewContext; }
69
70 GlewContextNative* glewGetContextNativeIV() const
71 { return m_glewContextNative; }
72
73 bool isGLEWInitialized() { return m_glewInit; }
74
82 bool initGLEW();
83 bool initGLXEW();
84 bool initEGLEW();
85
87};
88#endif // SOGLGLEW_H
void cleanGLEWContext()
struct GLEWContextStruct * glewGetContextIV() const
Definition SoGLGlew.h:67
bool isGLEWInitialized()
Definition SoGLGlew.h:73
struct GLEWContextStruct * m_glewContext
Definition SoGLGlew.h:61
SoGLGlew()
GlewContextNative * m_glewContextNative
Definition SoGLGlew.h:62
GlewContextNative * glewGetContextNativeIV() const
Definition SoGLGlew.h:70
bool initGLEW()
Intialize GLEW.
void initGLEWContext()
Initialize memory for GLEW structures.
bool initEGLEW()
bool initGLXEW()
~SoGLGlew()
bool m_glewInit
Definition SoGLGlew.h:64