ROOT  6.06/09
Reference Guide
TGLAdapter.cxx
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov, Jun 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, 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 #include "TGLAdapter.h"
13 
14 /** \class TGLAdapter
15 \ingroup opengl
16 Allow plot-painters to be used for gl-inpad and gl-viewer.
17 */
18 
20 
21 ////////////////////////////////////////////////////////////////////////////////
22 /// Constructor.
23 
24 TGLAdapter::TGLAdapter(Int_t glDevice)
25  : fGLDevice(glDevice)
26 {
27 }
28 
29 ////////////////////////////////////////////////////////////////////////////////
30 /// Set as current GL context.
31 
33 {
34  return fGLDevice != -1 && gGLManager->MakeCurrent(fGLDevice);
35 }
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// Swap front/back buffers.
39 
41 {
42  if (fGLDevice != -1)
43  gGLManager->Flush(fGLDevice);
44 }
45 
46 ////////////////////////////////////////////////////////////////////////////////
47 /// Mark gl-device for later copying into x-pixmap.
48 
50 {
51  gGLManager->MarkForDirectCopy(fGLDevice, isDirect);
52 }
53 
54 ////////////////////////////////////////////////////////////////////////////////
55 /// Read gl buffer into x-pixmap.
56 
58 {
59  gGLManager->ReadGLBuffer(fGLDevice);
60 }
61 
62 ////////////////////////////////////////////////////////////////////////////////
63 /// Extract viewport from gl.
64 
66 {
67  gGLManager->ExtractViewport(fGLDevice, vp);
68 }
69 
70 ////////////////////////////////////////////////////////////////////////////////
71 /// Select off-screen device for rendering.
72 
74 {
75  gGLManager->SelectOffScreenDevice(fGLDevice);
76 }
void ExtractViewport(Int_t *vp) const
Extract viewport from gl.
Definition: TGLAdapter.cxx:65
void SelectOffScreenDevice()
Select off-screen device for rendering.
Definition: TGLAdapter.cxx:73
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
ClassImp(TGLAdapter) TGLAdapter
Constructor.
Definition: TGLAdapter.cxx:19
void SwapBuffers()
Swap front/back buffers.
Definition: TGLAdapter.cxx:40
void ReadGLBuffer()
Read gl buffer into x-pixmap.
Definition: TGLAdapter.cxx:57
void MarkForDirectCopy(Bool_t isDirect)
Mark gl-device for later copying into x-pixmap.
Definition: TGLAdapter.cxx:49
Int_t fGLDevice
Definition: TGLAdapter.h:21
Allow plot-painters to be used for gl-inpad and gl-viewer.
Definition: TGLAdapter.h:19
#define gGLManager
Definition: TVirtualGL.h:168
Bool_t MakeCurrent()
Set as current GL context.
Definition: TGLAdapter.cxx:32