ROOT  6.06/09
Reference Guide
TGWin32GL.h
Go to the documentation of this file.
1 // @(#)root/win32gdk:$Id$
2 // Author: Valeriy Onuchin 05/08/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGWin32GL
13 #define ROOT_TGWin32GL
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGWin32GL //
19 // //
20 // The TGWin32GL is win32gdk implementation of TVirtualGLImp class. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TVirtualGL
25 #include "TVirtualGL.h"
26 #endif
27 #ifndef ROOT_TVirtualViewer3D
28 #include "TVirtualViewer3D.h"
29 #endif
30 
31 
32 class TGWin32GLManager : public TGLManager {
33 private:
34  class TGWin32GLImpl;
35  TGWin32GLImpl *fPimpl;
36 
37 public:
40 
41  //All public functions are TGLManager's final-overriders
42 
43  //index returned can be used as a result of gVirtualX->InitWindow
45  //winInd is the index, returned by InitGLWindow
46  Int_t CreateGLContext(Int_t winInd);
47 
48  //[ Off-screen rendering part
49  //create DIB section to read GL buffer into it,
50  //ctxInd is the index, returned by CreateGLContext
53  //analog of gVirtualX->SelectWindow(fPixmapID) => gVirtualGL->SelectOffScreenDevice(fPixmapID)
54  void SelectOffScreenDevice(Int_t devInd);
55  //Index of DIB, valid for gVirtualX
56  Int_t GetVirtualXInd(Int_t devInd);
57  //copy DIB into window directly/by pad
58  void MarkForDirectCopy(Int_t devInd, Bool_t);
59  //Off-screen device holds sizes for glViewport
60  void ExtractViewport(Int_t devInd, Int_t *vp);
61  //Read GL buffer into DIB
62  void ReadGLBuffer(Int_t devInd);
63  //]
64 
65  //Make the gl context current
66  Bool_t MakeCurrent(Int_t devInd);
67  //Swap buffers or "blits" DIB
68  void Flush(Int_t ctxInd);
69  //Generic function for gl context and off-screen device deletion
70  void DeleteGLContext(Int_t devInd);
71 
72  //functions to switch between threads in win32
73  //used by viewer
74  Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox);
75 
77  char *GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py);
78 
81  void PrintViewer(TVirtualViewer3D *vv);
82 
84 
85 private:
86  struct TGLContext;
87  Bool_t CreateDIB(TGLContext &ctx)const;
88 
91 
93 };
94 
95 #endif
char * GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py)
Definition: TGWin32GL.cxx:522
Int_t GetVirtualXInd(Int_t devInd)
Definition: TGWin32GL.cxx:407
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition: TGLCamera.h:43
void DeleteGLContext(Int_t devInd)
Definition: TGWin32GL.cxx:451
void MarkForDirectCopy(Int_t devInd, Bool_t)
Definition: TGWin32GL.cxx:386
Int_t CreateGLContext(Int_t winInd)
winInd is TGWin32 index, returned by previous call gGLManager->InitGLWindow returns descripto (index)...
Definition: TGWin32GL.cxx:254
TH1 * h
Definition: legend2.C:5
void ExtractViewport(Int_t devInd, Int_t *vp)
Definition: TGWin32GL.cxx:473
Int_t InitGLWindow(Window_t winID)
Definition: TGWin32GL.cxx:245
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Double_t x[n]
Definition: legend1.C:17
Bool_t AttachOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h)
Definition: TGWin32GL.cxx:337
#define ClassDef(name, id)
Definition: Rtypes.h:254
Bool_t ResizeOffScreenDevice(Int_t devInd, Int_t x, Int_t y, UInt_t w, UInt_t h)
Create new DIB if needed.
Definition: TGWin32GL.cxx:353
Viewport (pixel base) 2D rectangle class.
Definition: TGLUtil.h:426
Bool_t HighColorFormat(Int_t ctx)
Definition: TGWin32GL.cxx:529
Abstract 3D shapes viewer.
void PrintViewer(TVirtualViewer3D *vv)
Definition: TGWin32GL.cxx:494
Bool_t CreateDIB(TGLContext &ctx) const
Create DIB section to read GL buffer into.
Definition: TGWin32GL.cxx:304
void Flush(Int_t ctxInd)
Definition: TGWin32GL.cxx:422
TGLContext(TGLWidget *glWidget, Bool_t shareDefault=kTRUE, const TGLContext *shareList=0)
TGLContext ctor "from" TGLWidget.
Definition: TGLContext.cxx:51
unsigned int UInt_t
Definition: RtypesCore.h:42
Bool_t MakeCurrent(Int_t devInd)
Definition: TGWin32GL.cxx:414
Bool_t PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py)
Definition: TGWin32GL.cxx:515
void SelectOffScreenDevice(Int_t devInd)
Definition: TGWin32GL.cxx:379
Double_t y[n]
Definition: legend1.C:17
Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox)
Definition: TGWin32GL.cxx:501
TGWin32GLManager & operator=(const TGWin32GLManager &)
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
void ReadGLBuffer(Int_t devInd)
Definition: TGWin32GL.cxx:394
TGWin32GLImpl * fPimpl
Definition: TGWin32GL.h:34
Handle_t Window_t
Definition: GuiTypes.h:30
void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y)
Definition: TGWin32GL.cxx:508
void PaintSingleObject(TVirtualGLPainter *)
Definition: TGWin32GL.cxx:487