12 #ifndef ROOT_TGLWidget
13 #define ROOT_TGLWidget
27 class TGLWidget :
public TGFrame,
public TGLPaintDevice
29 friend class TGLContext;
32 TGLContext *fGLContext;
34 std::pair<void *, void *> fInnerData;
41 std::set<TGLContext *> fValidContexts;
43 TGEventHandler *fEventHandler;
46 static TGLWidget* CreateDummy();
48 static TGLWidget* Create(
const TGWindow* parent, Bool_t selectInput,
49 Bool_t shareDefault,
const TGLPaintDevice *shareDevice,
50 UInt_t width, UInt_t height);
52 static TGLWidget* Create(
const TGLFormat &format,
53 const TGWindow* parent, Bool_t selectInput,
54 Bool_t shareDefault,
const TGLPaintDevice *shareDevice,
55 UInt_t width, UInt_t height);
59 virtual void InitGL();
60 virtual void PaintGL();
63 Bool_t ClearCurrent();
65 const TGLContext *GetContext()
const;
67 const TGLFormat *GetPixelFormat()
const;
73 void ExtractViewport(Int_t *vp)
const;
75 TGEventHandler *GetEventHandler()
const {
return fEventHandler; }
76 void SetEventHandler(TGEventHandler *eh);
78 Bool_t HandleButton(Event_t *ev);
79 Bool_t HandleDoubleClick(Event_t *ev);
80 Bool_t HandleConfigureNotify(Event_t *ev);
81 Bool_t HandleKey(Event_t *ev);
82 Bool_t HandleMotion(Event_t *ev);
83 Bool_t HandleFocusChange(Event_t *);
84 Bool_t HandleCrossing(Event_t *);
89 TGLWidget(
const TGLWidget &);
90 TGLWidget &operator = (
const TGLWidget &);
93 TGLWidget(Window_t glw,
const TGWindow* parent, Bool_t selectInput);
95 static Window_t CreateWindow(
const TGWindow* parent,
const TGLFormat &format,
96 UInt_t width, UInt_t height,
97 std::pair<void *, void *>& innerData);
99 void AddContext(TGLContext *ctx);
100 void RemoveContext(TGLContext *ctx);
102 std::pair<void *, void *> GetInnerData()
const;
104 ClassDef(TGLWidget, 0);