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
The SoGlobalGLContextScope can be used to automatically push and pop the current GL context,...
SoGlobalGLContextScope()
Stores the current GL context and activates the global shared Open Inventor GL context.
int getShareID()
Returns the Open Inventor context share ID, which is required for GLRender actions.
static void registerSoQtGLWidgetGLContextCallbacks()
static int getGlobalShareID()
Returns 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.