#include <utility>
#include <list>
#ifndef ROOT_TGLContext
#define ROOT_TGLContext
class TGLContextIdentity;
#ifndef ROOT_TGLFormat
#include "TGLFormat.h"
#endif
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
class TGLContextPrivate;
class TGLPaintDevice;
class TGLWidget;
class TGLFontManager;
class TGLContext
{
friend class TGLContextPrivate;
friend class TGLWidget;
private:
TGLPaintDevice *fDevice;
TGLContextPrivate *fPimpl;
Bool_t fFromCtor;
Bool_t fValid;
TGLContextIdentity *fIdentity;
public:
TGLContext(TGLWidget *glWidget, Bool_t shareDefault=kTRUE, const TGLContext *shareList=0);
TGLContextIdentity *GetIdentity()const;
virtual ~TGLContext();
Bool_t MakeCurrent();
Bool_t ClearCurrent();
void SwapBuffers();
void SetContext(TGLWidget *widget, const TGLContext *shareList);
void Release();
Bool_t IsValid() const { return fValid; }
static TGLContext *GetCurrent();
private:
TGLContext(const TGLContext &);
TGLContext &operator = (const TGLContext &);
ClassDef(TGLContext, 0);
};
class TGLContextIdentity
{
protected:
TGLFontManager* fFontManager;
public:
TGLContextIdentity();
virtual ~TGLContextIdentity();
void AddRef(TGLContext* ctx);
void Release(TGLContext* ctx);
void AddClientRef() { ++fClientCnt; }
void ReleaseClient() { --fClientCnt; CheckDestroy(); }
Int_t GetRefCnt() const { return fCnt; }
Int_t GetClientRefCnt() const { return fClientCnt; }
Bool_t IsValid() const { return fCnt > 0; }
void RegisterDLNameRangeToWipe(UInt_t base, Int_t size);
void DeleteGLResources();
static TGLContextIdentity *GetCurrent();
static TGLContextIdentity *GetDefaultIdentity();
static TGLContext *GetDefaultContextAny();
TGLFontManager *GetFontManager();
private:
Int_t fCnt;
Int_t fClientCnt;
void CheckDestroy();
typedef std::pair<UInt_t, Int_t> DLRange_t;
typedef std::list<DLRange_t> DLTrash_t;
typedef DLTrash_t::const_iterator DLTrashIt_t;
typedef std::list<TGLContext*> CtxList_t;
DLTrash_t fDLTrash;
CtxList_t fCtxs;
static TGLContextIdentity * fgDefaultIdentity;
ClassDef(TGLContextIdentity, 0);
};
#endif
Last change: Tue Nov 18 08:46:32 2008
Last generated: 2008-11-18 08:46
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.