// @(#)root/gl:$Id$
// Author:  Timur Pocheptsov, Jun 2007

/*************************************************************************
 * 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.             *
 *************************************************************************/

#include "TGLAdapter.h"

//______________________________________________________________________________
//
// Allow plot-painters to be used for gl-inpad and gl-viewer.

ClassImp(TGLAdapter)

//______________________________________________________________________________
TGLAdapter::TGLAdapter(Int_t glDevice)
               : fGLDevice(glDevice)
{
   // Constructor.
}

//______________________________________________________________________________
Bool_t TGLAdapter::MakeCurrent()
{
   // Set as current GL contet.
   return fGLDevice != -1 && gGLManager->MakeCurrent(fGLDevice);
}

//______________________________________________________________________________
void TGLAdapter::SwapBuffers()
{
   // Swap front/back buffers.
   if (fGLDevice != -1)
      gGLManager->Flush(fGLDevice);
}

//______________________________________________________________________________
void TGLAdapter::MarkForDirectCopy(Bool_t isDirect)
{
   // Mark gl-device for later copying into x-pixmap.
   gGLManager->MarkForDirectCopy(fGLDevice, isDirect);
}

//______________________________________________________________________________
void TGLAdapter::ReadGLBuffer()
{
   // Read gl buffer into x-pixmap.
   gGLManager->ReadGLBuffer(fGLDevice);
}

//______________________________________________________________________________
void TGLAdapter::ExtractViewport(Int_t *vp)const
{
   // Extract viewport from gl.
   gGLManager->ExtractViewport(fGLDevice, vp);
}

//______________________________________________________________________________
void TGLAdapter::SelectOffScreenDevice()
{
   // Select off-screen device for rendering.
   gGLManager->SelectOffScreenDevice(fGLDevice);
}
 TGLAdapter.cxx:1
 TGLAdapter.cxx:2
 TGLAdapter.cxx:3
 TGLAdapter.cxx:4
 TGLAdapter.cxx:5
 TGLAdapter.cxx:6
 TGLAdapter.cxx:7
 TGLAdapter.cxx:8
 TGLAdapter.cxx:9
 TGLAdapter.cxx:10
 TGLAdapter.cxx:11
 TGLAdapter.cxx:12
 TGLAdapter.cxx:13
 TGLAdapter.cxx:14
 TGLAdapter.cxx:15
 TGLAdapter.cxx:16
 TGLAdapter.cxx:17
 TGLAdapter.cxx:18
 TGLAdapter.cxx:19
 TGLAdapter.cxx:20
 TGLAdapter.cxx:21
 TGLAdapter.cxx:22
 TGLAdapter.cxx:23
 TGLAdapter.cxx:24
 TGLAdapter.cxx:25
 TGLAdapter.cxx:26
 TGLAdapter.cxx:27
 TGLAdapter.cxx:28
 TGLAdapter.cxx:29
 TGLAdapter.cxx:30
 TGLAdapter.cxx:31
 TGLAdapter.cxx:32
 TGLAdapter.cxx:33
 TGLAdapter.cxx:34
 TGLAdapter.cxx:35
 TGLAdapter.cxx:36
 TGLAdapter.cxx:37
 TGLAdapter.cxx:38
 TGLAdapter.cxx:39
 TGLAdapter.cxx:40
 TGLAdapter.cxx:41
 TGLAdapter.cxx:42
 TGLAdapter.cxx:43
 TGLAdapter.cxx:44
 TGLAdapter.cxx:45
 TGLAdapter.cxx:46
 TGLAdapter.cxx:47
 TGLAdapter.cxx:48
 TGLAdapter.cxx:49
 TGLAdapter.cxx:50
 TGLAdapter.cxx:51
 TGLAdapter.cxx:52
 TGLAdapter.cxx:53
 TGLAdapter.cxx:54
 TGLAdapter.cxx:55
 TGLAdapter.cxx:56
 TGLAdapter.cxx:57
 TGLAdapter.cxx:58
 TGLAdapter.cxx:59
 TGLAdapter.cxx:60
 TGLAdapter.cxx:61
 TGLAdapter.cxx:62
 TGLAdapter.cxx:63
 TGLAdapter.cxx:64
 TGLAdapter.cxx:65
 TGLAdapter.cxx:66
 TGLAdapter.cxx:67
 TGLAdapter.cxx:68