Logo ROOT   6.12/07
Reference Guide
TGLContextPrivate.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov, Matevz Tadel, June 2007
3 
4 #ifndef ROOT_TGLContextPrivate
5 #define ROOT_TGLContextPrivate
6 
7 #include <map>
8 
9 #include "TGLIncludes.h"
10 #include "TGLWSIncludes.h"
11 #include "TGLContext.h"
12 #include "RConfigure.h"
13 #include "GuiTypes.h"
14 
15 #ifdef WIN32
16 
17 class TGLContextPrivate {
18 public:
19  HWND fHWND;
20  HDC fHDC;
21  HGLRC fGLContext;
22 
24  : fHWND(0),
25  fHDC(0),
26  fGLContext(0)
27  {
28  }
29  static void RegisterContext(TGLContext *ctx);
30  static void RemoveContext(TGLContext *ctx);
31  static TGLContext *GetCurrentContext();
32 
33 
34 private:
37 
38  static std::map<HGLRC, TGLContext *> fgContexts;
39 };
40 
41 #elif defined(R__HAS_COCOA)
42 
43 class TGLContextPrivate {
44 public:
47 
48 
50  : fGLContext(0)
51  {
52  }
53 
54  static void RegisterContext(TGLContext *ctx);
55  static void RemoveContext(TGLContext *ctx);
56  static TGLContext *GetCurrentContext();
57 
58 private:
61 
62  static std::map<Handle_t, TGLContext *> fgContexts;
63 };
64 
65 #else
66 
68 public:
69  Display *fDpy;
70  XVisualInfo *fVisualInfo;
71  GLXContext fGLContext;
73  //GLXPbuffer fPBDC;
74 
76  : fDpy(0),
77  fVisualInfo(0),
78  fGLContext(0),
79  fWindowID(0)
80  {
81  }
82 
83  static void RegisterContext(TGLContext *ctx);
84  static void RemoveContext(TGLContext *ctx);
85  static TGLContext *GetCurrentContext();
86 
87 private:
90 
91  static std::map<GLXContext, TGLContext *> fgContexts;
92 };
93 
94 #endif
95 #endif
static void RegisterContext(TGLContext *ctx)
Register gl-context to find it later as current (GetCurrentContext)
static void RemoveContext(TGLContext *ctx)
Un-register deleted context.
TGLContextPrivate & operator=(const TGLContextPrivate &)
XVisualInfo * fVisualInfo
static TGLContext * GetCurrentContext()
Ask wgl what HGLRC is current and look up corresponding TGLContext.
XID Window
Definition: TGX11.h:39
This class encapsulates window-system specific information about a GL-context and alows their proper ...
Definition: TGLContext.h:30
static std::map< GLXContext, TGLContext * > fgContexts
ULong_t Handle_t
Definition: GuiTypes.h:25