// @(#)root/gl:$Id$
// Author:  Timur Pocheptsov, Jun 2007

/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGLFormat
#define ROOT_TGLFormat

#include "TVirtualGL.h"
#include "Rtypes.h"

#include <vector>

/*
   TGLFormat class describes the pixel format of a drawing surface.
   It's a generic analog of PIXELFORMATDESCRIPTOR (win32) or
   array of integer constants array for glXChooseVisual (X11).
   This class is in a very preliminary state, different
   options have not been tested yet, only defaults.

   Surface can be:
   -RGBA
   -with/without depth buffer
   -with/without stencil buffer
   -with/without accum buffer
   -double/single buffered
*/

class TGLFormat
{
private:
   Bool_t fDoubleBuffered;
   Bool_t fStereo;
   Int_t  fDepthSize;
   Int_t  fAccumSize;
   Int_t  fStencilSize;
   Int_t  fSamples;

   static std::vector<Int_t> fgAvailableSamples;

   static Int_t GetDefaultSamples();
   static void  InitAvailableSamples();

public:
   TGLFormat();
   TGLFormat(Rgl::EFormatOptions options);

   //Virtual dtor only to supress warnings from g++ -
   //ClassDef adds virtual functions, so g++ wants virtual dtor.
   virtual ~TGLFormat();

   Bool_t operator == (const TGLFormat &rhs)const;
   Bool_t operator != (const TGLFormat &rhs)const;

   Int_t  GetDepthSize()const;
   void   SetDepthSize(Int_t depth);
   Bool_t HasDepth()const;

   Int_t  GetStencilSize()const;
   void   SetStencilSize(Int_t stencil);
   Bool_t HasStencil()const;

   Int_t  GetAccumSize()const;
   void   SetAccumSize(Int_t accum);
   Bool_t HasAccumBuffer()const;

   Bool_t IsDoubleBuffered()const;
   void   SetDoubleBuffered(Bool_t db);

   Bool_t IsStereo()const;
   void   SetStereo(Bool_t db);

   Int_t  GetSamples()const;
   void   SetSamples(Int_t samples);
   Bool_t HasMultiSampling()const;

   ClassDef(TGLFormat, 0); // Describes GL buffer format.
};

#endif
 TGLFormat.h:1
 TGLFormat.h:2
 TGLFormat.h:3
 TGLFormat.h:4
 TGLFormat.h:5
 TGLFormat.h:6
 TGLFormat.h:7
 TGLFormat.h:8
 TGLFormat.h:9
 TGLFormat.h:10
 TGLFormat.h:11
 TGLFormat.h:12
 TGLFormat.h:13
 TGLFormat.h:14
 TGLFormat.h:15
 TGLFormat.h:16
 TGLFormat.h:17
 TGLFormat.h:18
 TGLFormat.h:19
 TGLFormat.h:20
 TGLFormat.h:21
 TGLFormat.h:22
 TGLFormat.h:23
 TGLFormat.h:24
 TGLFormat.h:25
 TGLFormat.h:26
 TGLFormat.h:27
 TGLFormat.h:28
 TGLFormat.h:29
 TGLFormat.h:30
 TGLFormat.h:31
 TGLFormat.h:32
 TGLFormat.h:33
 TGLFormat.h:34
 TGLFormat.h:35
 TGLFormat.h:36
 TGLFormat.h:37
 TGLFormat.h:38
 TGLFormat.h:39
 TGLFormat.h:40
 TGLFormat.h:41
 TGLFormat.h:42
 TGLFormat.h:43
 TGLFormat.h:44
 TGLFormat.h:45
 TGLFormat.h:46
 TGLFormat.h:47
 TGLFormat.h:48
 TGLFormat.h:49
 TGLFormat.h:50
 TGLFormat.h:51
 TGLFormat.h:52
 TGLFormat.h:53
 TGLFormat.h:54
 TGLFormat.h:55
 TGLFormat.h:56
 TGLFormat.h:57
 TGLFormat.h:58
 TGLFormat.h:59
 TGLFormat.h:60
 TGLFormat.h:61
 TGLFormat.h:62
 TGLFormat.h:63
 TGLFormat.h:64
 TGLFormat.h:65
 TGLFormat.h:66
 TGLFormat.h:67
 TGLFormat.h:68
 TGLFormat.h:69
 TGLFormat.h:70
 TGLFormat.h:71
 TGLFormat.h:72
 TGLFormat.h:73
 TGLFormat.h:74
 TGLFormat.h:75
 TGLFormat.h:76
 TGLFormat.h:77
 TGLFormat.h:78
 TGLFormat.h:79
 TGLFormat.h:80
 TGLFormat.h:81
 TGLFormat.h:82
 TGLFormat.h:83
 TGLFormat.h:84
 TGLFormat.h:85
 TGLFormat.h:86