MeVisLab Resolution Independence API
SoGlobalGLContextScope.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2008, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef SO_GLOBAL_GLCONTEXT_SCOPE_H
14#define SO_GLOBAL_GLCONTEXT_SCOPE_H
15
17
18#include <mlGLContext.h>
19
20class SoGlobalGLSharedContextBase;
21class QOpenGLContext;
22class QSurface;
23
36
37public:
40
43
45 void deactivate();
46
49
51 static int getGlobalShareID();
52
54
55private:
57 static void initializeGlobalContext();
58
60 static SoGlobalGLSharedContextBase* createGlobalContext();
61
62 static SoGlobalGLSharedContextBase* _globalContext;
63 static bool _globalIsCurrent;
64
68 static void makeCurrentCB(void* scopeContainer);
69 static void doneCurrentCB(void* scopeContainer);
71
73 static SoGlobalGLContextScope* _activeScope;
74
76 static QOpenGLContext* _previousContext;
77 static QSurface* _previousSurface;
78};
79
80#endif // of __SoGlobalGLContextScope_H
#define INVENTORGUIWRAPPER_API
Library initialization interface of the inventor GUI wrapper.
The SoGlobalGLContextScope can be used to automatically push/pop the current GL context and to enable...
SoGlobalGLContextScope()
Stores current GL context and activates global shared Open Inventor GL context.
int getShareID()
Get the Open Inventor context share id, which is required for GLRender actions.
static void registerSoQtGLWidgetGLContextCallbacks()
static int getGlobalShareID()
Get the global Open Inventor context share id, which is required for GLRender actions.
void deactivate()
Activates the previous stored GL context (same as destructor).
~SoGlobalGLContextScope()
Activates the previous stored GL context.