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 
20 class SoGlobalGLSharedContextBase;
21 class QGLWidget;
22 
35 
36 public:
39 
42 
44  void deactivate();
45 
47  int getShareID();
48 
50  static QGLWidget* getGlobalGLWidget();
51 
53  static int getGlobalShareID();
54 
56 
58  static bool useNewOpenGLWidget();
59 
60 private:
62  static void initializeGlobalContext();
63 
65  static SoGlobalGLSharedContextBase* createGlobalContext();
66 
67  static SoGlobalGLSharedContextBase* _globalContext;
68  static bool _globalIsCurrent;
69 
73  static void makeCurrentCB(void* scopeContainer);
74  static void doneCurrentCB(void* scopeContainer);
76 
78  static SoGlobalGLContextScope* _activeScope;
79 };
80 
81 #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...
static bool useNewOpenGLWidget()
Forwarding of SoQt::useNewOpenGLWidget()
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 QGLWidget * getGlobalGLWidget()
Get access to globally shared QGLWidget.
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.