Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGLFBO.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Matevz Tadel, Aug 2009
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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_TGLFBO
13 #define ROOT_TGLFBO
14 
15 #include "Rtypes.h"
16 
17 class TGLFBO
18 {
19 private:
20  TGLFBO(const TGLFBO&); // Not implemented
21  TGLFBO& operator=(const TGLFBO&); // Not implemented
22 
23 protected:
24  UInt_t fFrameBuffer;
25  UInt_t fColorTexture;
26  UInt_t fDepthBuffer;
27  UInt_t fMSFrameBuffer;
28  UInt_t fMSColorBuffer;
29 
30  Int_t fW, fH, fReqW, fReqH, fMSSamples, fMSCoverageSamples;
31 
32  Float_t fWScale, fHScale;
33  Bool_t fIsRescaled;
34 
35  static Bool_t fgRescaleToPow2;
36  static Bool_t fgMultiSampleNAWarned;
37 
38  void InitStandard();
39  void InitMultiSample();
40 
41  UInt_t CreateAndAttachRenderBuffer(Int_t format, Int_t type);
42  UInt_t CreateAndAttachColorTexture();
43 
44 public:
45  TGLFBO();
46  virtual ~TGLFBO();
47 
48  void Init(int w, int h, int ms_samples=0);
49  void Release();
50 
51  void Bind();
52  void Unbind();
53 
54  void BindTexture();
55  void UnbindTexture();
56 
57  void SetAsReadBuffer();
58 
59  Int_t GetW() const { return fW; }
60  Int_t GetH() const { return fH; }
61  Int_t GetReqW() const { return fReqW; }
62  Int_t GetReqH() const { return fReqH; }
63  Int_t GetMSSamples() const { return fMSSamples; }
64  Int_t GetMSCoverageSamples() const { return fMSCoverageSamples; }
65 
66  Float_t GetWScale() const { return fWScale; }
67  Float_t GetHScale() const { return fHScale; }
68 
69  Bool_t GetIsRescaled() const { return fIsRescaled; }
70 
71  static Bool_t GetRescaleToPow2();
72  static void SetRescaleToPow2(Bool_t r);
73 
74  ClassDef(TGLFBO, 0); // Frame-buffer object.
75 };
76 
77 #endif