Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:59

0001 // @(#)root/gl:$Id$
0002 // Author:  Timur Pocheptsov, Jun 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGLFormat
0013 #define ROOT_TGLFormat
0014 
0015 #include "TVirtualGL.h"
0016 #include "Rtypes.h"
0017 
0018 #include <vector>
0019 
0020 /*
0021    TGLFormat class describes the pixel format of a drawing surface.
0022    It's a generic analog of PIXELFORMATDESCRIPTOR (win32) or
0023    array of integer constants array for glXChooseVisual (X11).
0024    This class is in a very preliminary state, different
0025    options have not been tested yet, only defaults.
0026 
0027    Surface can be:
0028    -RGBA
0029    -with/without depth buffer
0030    -with/without stencil buffer
0031    -with/without accum buffer
0032    -double/single buffered
0033 */
0034 
0035 class TGLFormat
0036 {
0037 private:
0038    Bool_t fDoubleBuffered;
0039    Bool_t fStereo;
0040    Int_t  fDepthSize;
0041    Int_t  fAccumSize;
0042    Int_t  fStencilSize;
0043    Int_t  fSamples;
0044 
0045    static std::vector<Int_t> fgAvailableSamples;
0046 
0047    static Int_t GetDefaultSamples();
0048    static void  InitAvailableSamples();
0049 
0050 public:
0051    TGLFormat();
0052    TGLFormat(Rgl::EFormatOptions options);
0053 
0054    //Virtual dtor only to supress warnings from g++ -
0055    //ClassDef adds virtual functions, so g++ wants virtual dtor.
0056    virtual ~TGLFormat();
0057 
0058    Bool_t operator == (const TGLFormat &rhs)const;
0059    Bool_t operator != (const TGLFormat &rhs)const;
0060 
0061    Int_t  GetDepthSize()const;
0062    void   SetDepthSize(Int_t depth);
0063    Bool_t HasDepth()const;
0064 
0065    Int_t  GetStencilSize()const;
0066    void   SetStencilSize(Int_t stencil);
0067    Bool_t HasStencil()const;
0068 
0069    Int_t  GetAccumSize()const;
0070    void   SetAccumSize(Int_t accum);
0071    Bool_t HasAccumBuffer()const;
0072 
0073    Bool_t IsDoubleBuffered()const;
0074    void   SetDoubleBuffered(Bool_t db);
0075 
0076    Bool_t IsStereo()const;
0077    void   SetStereo(Bool_t db);
0078 
0079    Int_t  GetSamples()const;
0080    void   SetSamples(Int_t samples);
0081    Bool_t HasMultiSampling()const;
0082 
0083    ClassDef(TGLFormat, 0); // Describes GL buffer format.
0084 };
0085 
0086 #endif