Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
16Allow plot-painters to be used for gl-inpad and gl-viewer.
17*/
18
20
21////////////////////////////////////////////////////////////////////////////////
22/// Constructor.
23
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}
#define ClassImp(name)
Definition Rtypes.h:377
#define gGLManager
Definition TVirtualGL.h:159
Allow plot-painters to be used for gl-inpad and gl-viewer.
Definition TGLAdapter.h:17
void SelectOffScreenDevice()
Select off-screen device for rendering.
void ReadGLBuffer()
Read gl buffer into x-pixmap.
TGLAdapter(Int_t glDevice=-1)
Constructor.
void ExtractViewport(Int_t *vp) const override
Extract viewport from gl.
void SwapBuffers() override
Swap front/back buffers.
Int_t fGLDevice
Definition TGLAdapter.h:19
void MarkForDirectCopy(Bool_t isDirect)
Mark gl-device for later copying into x-pixmap.
Bool_t MakeCurrent() override
Set as current GL context.