TGLContextPrivate.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLContextPrivate.h 29056 2009-06-17 14:36:59Z matevz $
00002 // Author:  Timur Pocheptsov, Matevz Tadel, June 2007
00003 
00004 #ifndef ROOT_TGLContextPrivate
00005 #define ROOT_TGLContextPrivate
00006 
00007 #include <map>
00008 
00009 #include "TGLIncludes.h"
00010 #include "TGLWSIncludes.h"
00011 #include "TGLContext.h"
00012 
00013 #ifdef WIN32
00014 
00015 class TGLContextPrivate {
00016 public:
00017    HWND        fHWND;
00018    HDC         fHDC;
00019    HGLRC       fGLContext;
00020 
00021    TGLContextPrivate()
00022       : fHWND(0),
00023         fHDC(0),
00024         fGLContext(0)
00025    {
00026    }
00027    static void RegisterContext(TGLContext *ctx);
00028    static void RemoveContext(TGLContext *ctx);
00029    static TGLContext *GetCurrentContext();
00030 
00031 
00032 private:
00033    TGLContextPrivate(const TGLContextPrivate &);
00034    TGLContextPrivate &operator = (const TGLContextPrivate &);
00035 
00036    static std::map<HGLRC, TGLContext *> fgContexts;
00037 };
00038 
00039 
00040 #else
00041 
00042 class TGLContextPrivate {
00043 public:
00044    Display     *fDpy;
00045    XVisualInfo *fVisualInfo;
00046    GLXContext   fGLContext;
00047    Window       fWindowID;
00048    //GLXPbuffer   fPBDC;
00049 
00050    TGLContextPrivate()
00051       : fDpy(0),
00052         fVisualInfo(0),
00053         fGLContext(0),
00054         fWindowID(0)
00055    {
00056    }
00057 
00058    static void RegisterContext(TGLContext *ctx);
00059    static void RemoveContext(TGLContext *ctx);
00060    static TGLContext *GetCurrentContext();
00061 
00062 private:
00063    TGLContextPrivate(const TGLContextPrivate &);
00064    TGLContextPrivate &operator = (const TGLContextPrivate &);
00065 
00066    static std::map<GLXContext, TGLContext *> fgContexts;
00067 };
00068 
00069 #endif
00070 
00071 #endif

Generated on Tue Jul 5 14:16:43 2011 for ROOT_528-00b_version by  doxygen 1.5.1