ROOT
6.08/07
Reference Guide
core
base
src
TVirtualGL.cxx
Go to the documentation of this file.
1
// @(#)root/base:$Id$
2
// Author: Valery Fine 05/03/97
3
4
/** \class TVirtualGL
5
6
The TVirtualGL class is an abstract base class defining the
7
OpenGL interface protocol. All interactions with OpenGL should be
8
done via the global pointer gVirtualGL. If the OpenGL library is
9
available this pointer is pointing to an instance of the TGLKernel
10
class which provides the actual interface to OpenGL. Using this
11
scheme of ABC we can use OpenGL in other parts of the framework
12
without having to link with the OpenGL library in case we don't
13
use the classes using OpenGL.
14
*/
15
16
#include "
TVirtualGL.h
"
17
#include "
TROOT.h
"
18
#include "
TGlobal.h
"
19
20
21
ClassImp
(
TGLManager
)
22
23
TGLManager
* (*
gPtr2GLManager
)() = 0;
24
25
namespace {
26
static
struct
AddPseudoGlobals {
27
AddPseudoGlobals() {
28
// User "gCling" as synonym for "libCore static initialization has happened".
29
// This code here must not trigger it.
30
TGlobalMappedFunction::Add
(
new
TGlobalMappedFunction
(
"gGLManager"
,
"TVirtualGL*"
,
31
(
TGlobalMappedFunction::GlobalFunc_t
)&
gGLManager
));
32
}
33
} gAddPseudoGlobals;
34
}
35
36
////////////////////////////////////////////////////////////////////////////////
37
38
TGLManager::TGLManager
() :
TNamed
(
"gGLManager"
,
""
)
39
{
40
}
41
42
////////////////////////////////////////////////////////////////////////////////
43
/// Return the global GL Manager.
44
45
TGLManager
*&
TGLManager::Instance
()
46
{
47
static
TGLManager
*instance = 0;
48
49
if
(
gPtr2GLManager
) {
50
instance =
gPtr2GLManager
();
51
}
52
53
return
instance;
54
}
55
56
ClassImp
(
TVirtualGLPainter
)
57
58
59
ClassImp
(
TVirtualGLManip
)
60
61
ClassImp
(
TGLPaintDevice
)
TGLManager::TGLManager
TGLManager()
Definition:
TVirtualGL.cxx:38
TVirtualGL.h
TGLPaintDevice
Definition:
TVirtualGL.h:150
TGlobal.h
TGlobalMappedFunction
Definition:
TGlobal.h:54
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition:
TNamed.h:33
TVirtualGLPainter
Definition:
TVirtualGL.h:51
TROOT.h
TGLManager::Instance
static TGLManager *& Instance()
Return the global GL Manager.
Definition:
TVirtualGL.cxx:45
TGlobalMappedFunction::Add
static void Add(TGlobalMappedFunction *gmf)
Definition:
TGlobal.cxx:178
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:279
gGLManager
#define gGLManager
Definition:
TVirtualGL.h:168
TGLManager
Definition:
TVirtualGL.h:76
gPtr2GLManager
TGLManager *(* gPtr2GLManager)()=0
Definition:
TVirtualGL.cxx:23
TGlobalMappedFunction::GlobalFunc_t
void *(* GlobalFunc_t)()
Definition:
TGlobal.h:56
TVirtualGLManip
Definition:
TVirtualGL.h:65