/usr/include/root/TGLContext.h is in libroot-graf3d-gl-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | // @(#)root/gl:$Id$
// Author: Timur Pocheptsov, Jun 2007
#include <utility>
#include <list>
/*************************************************************************
* Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#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 TGLPBuffer;
class TGLWidget;
class TGLFontManager;
class TGLContext
{
friend class TGLContextPrivate;
friend class TGLWidget;
// friend class TGLPBuffer;
private:
TGLPaintDevice *fDevice;
TGLContextPrivate *fPimpl;
Bool_t fFromCtor;//To prohibit user's calls of SetContext.
Bool_t fValid;
TGLContextIdentity *fIdentity;
static Bool_t fgGlewInitDone;
public:
TGLContext(TGLWidget *glWidget, Bool_t shareDefault=kTRUE, const TGLContext *shareList=0);
// TGLContext(TGLPBuffer *glPbuf, const TGLContext *shareList = 0);
TGLContextIdentity *GetIdentity()const;
virtual ~TGLContext();
Bool_t MakeCurrent();
Bool_t ClearCurrent();
void SwapBuffers();
//This functions are public _ONLY_ for calls via
//gROOT under win32. Please, DO NOT CALL IT DIRECTLY.
void SetContext(TGLWidget *widget, const TGLContext *shareList);
// void SetContextPB(TGLPBuffer *pbuff, const TGLContext *shareList);
void Release();
Bool_t IsValid() const { return fValid; }
static TGLContext *GetCurrent();
static void GlewInit();
private:
TGLContext(const TGLContext &);
TGLContext &operator = (const TGLContext &);
ClassDef(TGLContext, 0); // Control internal gl-context resources.
};
//______________________________________________________________________________
class TGLContextIdentity
{
protected:
TGLFontManager* fFontManager; // FreeType font manager.
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); // Identity of a shared GL context.
};
#endif
|