TGLAdapter.cxx

Go to the documentation of this file.
00001 // @(#)root/gl:$Id: TGLAdapter.cxx 21453 2007-12-18 15:18:30Z matevz $
00002 // Author:  Timur Pocheptsov, Jun 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include "TGLAdapter.h"
00013 
00014 //______________________________________________________________________________
00015 //
00016 // Allow plot-painters to be used for gl-inpad and gl-viewer.
00017 
00018 ClassImp(TGLAdapter)
00019 
00020 //______________________________________________________________________________
00021 TGLAdapter::TGLAdapter(Int_t glDevice)
00022                : fGLDevice(glDevice)
00023 {
00024    // Constructor.
00025 }
00026 
00027 //______________________________________________________________________________
00028 Bool_t TGLAdapter::MakeCurrent()
00029 {
00030    // Set as current GL contet.
00031    return fGLDevice != -1 && gGLManager->MakeCurrent(fGLDevice);
00032 }
00033 
00034 //______________________________________________________________________________
00035 void TGLAdapter::SwapBuffers()
00036 {
00037    // Swap front/back buffers.
00038    if (fGLDevice != -1)
00039       gGLManager->Flush(fGLDevice);
00040 }
00041 
00042 //______________________________________________________________________________
00043 void TGLAdapter::MarkForDirectCopy(Bool_t isDirect)
00044 {
00045    // Mark gl-device for later copying into x-pixmap.
00046    gGLManager->MarkForDirectCopy(fGLDevice, isDirect);
00047 }
00048 
00049 //______________________________________________________________________________
00050 void TGLAdapter::ReadGLBuffer()
00051 {
00052    // Read gl buffer into x-pixmap.
00053    gGLManager->ReadGLBuffer(fGLDevice);
00054 }
00055 
00056 //______________________________________________________________________________
00057 void TGLAdapter::ExtractViewport(Int_t *vp)const
00058 {
00059    // Extract viewport from gl.
00060    gGLManager->ExtractViewport(fGLDevice, vp);
00061 }
00062 
00063 //______________________________________________________________________________
00064 void TGLAdapter::SelectOffScreenDevice()
00065 {
00066    // Select off-screen device for rendering.
00067    gGLManager->SelectOffScreenDevice(fGLDevice);
00068 }

Generated on Tue Jul 5 14:18:05 2011 for ROOT_528-00b_version by  doxygen 1.5.1