Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGLFormat.h
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 #ifndef ROOT_TGLFormat
13 #define ROOT_TGLFormat
14 
15 #include "TVirtualGL.h"
16 #include "Rtypes.h"
17 
18 #include <vector>
19 
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.
26 
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 */
34 
35 class TGLFormat
36 {
37 private:
38  Bool_t fDoubleBuffered;
39  Bool_t fStereo;
40  Int_t fDepthSize;
41  Int_t fAccumSize;
42  Int_t fStencilSize;
43  Int_t fSamples;
44 
45  static std::vector<Int_t> fgAvailableSamples;
46 
47  static Int_t GetDefaultSamples();
48  static void InitAvailableSamples();
49 
50 public:
51  TGLFormat();
52  TGLFormat(Rgl::EFormatOptions options);
53 
54  //Virtual dtor only to supress warnings from g++ -
55  //ClassDef adds virtual functions, so g++ wants virtual dtor.
56  virtual ~TGLFormat();
57 
58  Bool_t operator == (const TGLFormat &rhs)const;
59  Bool_t operator != (const TGLFormat &rhs)const;
60 
61  Int_t GetDepthSize()const;
62  void SetDepthSize(Int_t depth);
63  Bool_t HasDepth()const;
64 
65  Int_t GetStencilSize()const;
66  void SetStencilSize(Int_t stencil);
67  Bool_t HasStencil()const;
68 
69  Int_t GetAccumSize()const;
70  void SetAccumSize(Int_t accum);
71  Bool_t HasAccumBuffer()const;
72 
73  Bool_t IsDoubleBuffered()const;
74  void SetDoubleBuffered(Bool_t db);
75 
76  Bool_t IsStereo()const;
77  void SetStereo(Bool_t db);
78 
79  Int_t GetSamples()const;
80  void SetSamples(Int_t samples);
81  Bool_t HasMultiSampling()const;
82 
83  ClassDef(TGLFormat, 0); // Describes GL buffer format.
84 };
85 
86 #endif