Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
18public:
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);
32
33
34private:
37
38 static std::map<HGLRC, TGLContext *> fgContexts;
39};
40
41#elif defined(R__HAS_COCOA)
42
44public:
47
48
50 : fGLContext(0)
51 {
52 }
53
54 static void RegisterContext(TGLContext *ctx);
55 static void RemoveContext(TGLContext *ctx);
57
58private:
61
62 static std::map<Handle_t, TGLContext *> fgContexts;
63};
64
65#else
66
68public:
69 Display *fDpy;
71 GLXContext fGLContext;
73 //GLXPbuffer fPBDC;
74
76 : fDpy(nullptr),
77 fVisualInfo(nullptr),
78 fGLContext(nullptr),
79 fWindowID(0)
80 {
81 }
82
83 static void RegisterContext(TGLContext *ctx);
84 static void RemoveContext(TGLContext *ctx);
86
87private:
90
91 static std::map<GLXContext, TGLContext *> fgContexts;
92};
93
94#endif
95#endif
ULongptr_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
XID Window
Definition TGX11.h:36
static std::map< GLXContext, TGLContext * > fgContexts
static void RegisterContext(TGLContext *ctx)
Register gl-context to find it later as current (GetCurrentContext)
static void RemoveContext(TGLContext *ctx)
Un-register deleted context.
static TGLContext * GetCurrentContext()
Ask wgl what HGLRC is current and look up corresponding TGLContext.
XVisualInfo * fVisualInfo
TGLContextPrivate(const TGLContextPrivate &)
TGLContextPrivate & operator=(const TGLContextPrivate &)
This class encapsulates window-system specific information about a GL-context and alows their proper ...
Definition TGLContext.h:31