Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
36{
37private:
44
45 static std::vector<Int_t> fgAvailableSamples;
46
47 static Int_t GetDefaultSamples();
48 static void InitAvailableSamples();
49
50public:
51 TGLFormat();
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;
72
75
76 Bool_t IsStereo()const;
77 void SetStereo(Bool_t db);
78
79 Int_t GetSamples()const;
80 void SetSamples(Int_t samples);
82
83 ClassDef(TGLFormat, 0); // Describes GL buffer format.
84};
85
86#endif
#define ClassDef(name, id)
Definition Rtypes.h:325
Encapsulation of format / contents of an OpenGL buffer.
Definition TGLFormat.h:36
void SetStereo(Bool_t db)
Set the surface as stereo/non-stereo buffered.
Bool_t IsStereo() const
Check, if the surface is stereo buffered.
Int_t GetDepthSize() const
Get the size of depth buffer.
static Int_t GetDefaultSamples()
Return default number of samples for multi-sampling.
static void InitAvailableSamples()
Bool_t fDoubleBuffered
Definition TGLFormat.h:38
virtual ~TGLFormat()
Destructor.
Definition TGLFormat.cxx:80
Bool_t operator!=(const TGLFormat &rhs) const
Check for non-equality.
Definition TGLFormat.cxx:96
Int_t fStencilSize
Definition TGLFormat.h:42
Int_t GetStencilSize() const
Get the size of stencil buffer.
Bool_t fStereo
Definition TGLFormat.h:39
Int_t fDepthSize
Definition TGLFormat.h:40
void SetAccumSize(Int_t accum)
Set the size of accum buffer.
void SetSamples(Int_t samples)
Set the number of samples for multi-sampling.
Int_t fAccumSize
Definition TGLFormat.h:41
void SetDoubleBuffered(Bool_t db)
Set the surface as double/single buffered.
static std::vector< Int_t > fgAvailableSamples
Definition TGLFormat.h:45
Bool_t HasMultiSampling() const
Check, if multi-sampling is required.
Int_t GetSamples() const
Get the number of samples for multi-sampling.
Bool_t HasStencil() const
Check, if this surface has stencil buffer.
void SetStencilSize(Int_t stencil)
Set the size of stencil buffer.
Bool_t HasDepth() const
Check, if this surface has depth buffer.
Bool_t IsDoubleBuffered() const
Check, if the surface is double buffered.
Int_t GetAccumSize() const
Get the size of accum buffer.
Bool_t operator==(const TGLFormat &rhs) const
Check if two formats are equal.
Definition TGLFormat.cxx:87
Bool_t HasAccumBuffer() const
Check, if this surface has accumulation buffer.
void SetDepthSize(Int_t depth)
Set the size of color buffer.
Int_t fSamples
Definition TGLFormat.h:43
EFormatOptions
Definition TVirtualGL.h:129
static char accum[256]
Definition gifencode.c:210