Logo ROOT   6.14/05
Reference Guide
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov, Jun 2007
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  *************************************************************************/
12 #ifndef ROOT_TGLFormat
13 #define ROOT_TGLFormat
15 #include "TVirtualGL.h"
16 #include "Rtypes.h"
18 #include <vector>
20 /*
21  TGLFormat class describes the pixel format of a drawing surface.
22  It's a generic analog of PIXELFORMATDESCRIPTOR (win32) or
23  array of integer constants array for glXChooseVisual (X11).
24  This class is in a very preliminary state, different
25  options have not been tested yet, only defaults.
27  Surface can be:
28  -RGBA
29  -with/without depth buffer
30  -with/without stencil buffer
31  -with/without accum buffer
32  -double/single buffered
33 */
35 class TGLFormat
36 {
37 private:
45  static std::vector<Int_t> fgAvailableSamples;
47  static Int_t GetDefaultSamples();
48  static void InitAvailableSamples();
50 public:
51  TGLFormat();
54  //Virtual dtor only to supress warnings from g++ -
55  //ClassDef adds virtual functions, so g++ wants virtual dtor.
56  virtual ~TGLFormat();
58  Bool_t operator == (const TGLFormat &rhs)const;
59  Bool_t operator != (const TGLFormat &rhs)const;
61  Int_t GetDepthSize()const;
62  void SetDepthSize(Int_t depth);
63  Bool_t HasDepth()const;
65  Int_t GetStencilSize()const;
66  void SetStencilSize(Int_t stencil);
67  Bool_t HasStencil()const;
69  Int_t GetAccumSize()const;
70  void SetAccumSize(Int_t accum);
71  Bool_t HasAccumBuffer()const;
73  Bool_t IsDoubleBuffered()const;
74  void SetDoubleBuffered(Bool_t db);
76  Bool_t IsStereo()const;
77  void SetStereo(Bool_t db);
79  Int_t GetSamples()const;
80  void SetSamples(Int_t samples);
81  Bool_t HasMultiSampling()const;
83  ClassDef(TGLFormat, 0); // Describes GL buffer format.
84 };
86 #endif
Int_t GetDepthSize() const
Get the size of depth buffer.
Definition: TGLFormat.cxx:104
Int_t GetStencilSize() const
Get the size of stencil buffer.
Definition: TGLFormat.cxx:129
Int_t fDepthSize
Definition: TGLFormat.h:40
Bool_t operator!=(const TGLFormat &rhs) const
Check for non-equality.
Definition: TGLFormat.cxx:96
Int_t fAccumSize
Definition: TGLFormat.h:41
Int_t GetSamples() const
Get the number of samples for multi-sampling.
Definition: TGLFormat.cxx:211
Bool_t operator==(const TGLFormat &rhs) const
Check if two formats are equal.
Definition: TGLFormat.cxx:87
void SetStencilSize(Int_t stencil)
Set the size of stencil buffer.
Definition: TGLFormat.cxx:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
static Int_t GetDefaultSamples()
Return default number of samples for multi-sampling.
Definition: TGLFormat.cxx:235
void SetAccumSize(Int_t accum)
Set the size of accum buffer.
Definition: TGLFormat.cxx:162
#define ClassDef(name, id)
Definition: Rtypes.h:320
Bool_t HasMultiSampling() const
Check, if multi-sampling is required.
Definition: TGLFormat.cxx:227
void SetDoubleBuffered(Bool_t db)
Set the surface as double/single buffered.
Definition: TGLFormat.cxx:187
Encapsulation of format / contents of an OpenGL buffer.
Definition: TGLFormat.h:35
Bool_t IsDoubleBuffered() const
Check, if the surface is double buffered.
Definition: TGLFormat.cxx:179
Definition: TVirtualGL.h:128
Bool_t HasDepth() const
Check, if this surface has depth buffer.
Definition: TGLFormat.cxx:121
Int_t fSamples
Definition: TGLFormat.h:43
static void InitAvailableSamples()
Definition: TGLFormat.cxx:263
Bool_t fStereo
Definition: TGLFormat.h:39
void SetSamples(Int_t samples)
Set the number of samples for multi-sampling.
Definition: TGLFormat.cxx:219
void SetStereo(Bool_t db)
Set the surface as stereo/non-stereo buffered.
Definition: TGLFormat.cxx:203
static std::vector< Int_t > fgAvailableSamples
Definition: TGLFormat.h:45
static char accum[256]
Definition: gifencode.c:210
Bool_t HasStencil() const
Check, if this surface has stencil buffer.
Definition: TGLFormat.cxx:146
Int_t fStencilSize
Definition: TGLFormat.h:42
Bool_t IsStereo() const
Check, if the surface is stereo buffered.
Definition: TGLFormat.cxx:195
Int_t GetAccumSize() const
Get the size of accum buffer.
Definition: TGLFormat.cxx:154
void SetDepthSize(Int_t depth)
Set the size of color buffer.
Definition: TGLFormat.cxx:112
Bool_t fDoubleBuffered
Definition: TGLFormat.h:38
Bool_t HasAccumBuffer() const
Check, if this surface has accumulation buffer.
Definition: TGLFormat.cxx:171
virtual ~TGLFormat()
Definition: TGLFormat.cxx:80