TDME2  1.9.200
GeometryBuffer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 
5 #include <tdme/tdme.h>
6 #include <tdme/engine/fwd-tdme.h>
7 
8 using std::vector;
9 
12 
13 /**
14  * Geometry buffer class
15  * @author Andreas Drewke
16  */
18 {
19 private:
20  int32_t width;
21  int32_t height;
22  int32_t frameBufferId;
32 
33 public:
34  // forbid class copy
36 
37  /**
38  * Public constructor
39  * @param width width
40  * @param height height
41  */
42  GeometryBuffer(int32_t width, int32_t height);
43 
44  /**
45  * @return width
46  */
47  inline int32_t getWidth() {
48  return width;
49  }
50 
51  /**
52  * @return height
53  */
54  inline int32_t getHeight() {
55  return height;
56  }
57 
58  /**
59  * @return frame buffer id
60  */
61  inline int32_t getId() {
62  return frameBufferId;
63  }
64 
65  /**
66  * @return depth buffer texture
67  */
68  inline int32_t getDepthBufferTextureId() {
69  return depthBufferTextureId;
70  }
71 
72  /**
73  * @return geometry buffer texture 1
74  */
75  inline int32_t getGeometryBufferTextureId1() {
77  }
78 
79  /**
80  * @return geometry buffer texture 2
81  */
82  inline int32_t getGeometryBufferTextureId2() {
84  }
85 
86  /**
87  * @return geometry buffer texture 2
88  */
89  inline int32_t getGeometryBufferTextureId3() {
91  }
92 
93  /**
94  * @return color buffer texture 1
95  */
96  inline int32_t getColorBufferTextureId1() {
97  return colorBufferTextureId1;
98  }
99 
100  /**
101  * @return color buffer texture 2
102  */
103  inline int32_t getColorBufferTextureId2() {
104  return colorBufferTextureId2;
105  }
106 
107  /**
108  * @return color buffer texture 3
109  */
110  inline int32_t getColorBufferTextureId3() {
111  return colorBufferTextureId3;
112  }
113 
114  /**
115  * @return color buffer texture 4
116  */
117  inline int32_t getColorBufferTextureId4() {
118  return colorBufferTextureId4;
119  }
120 
121  /**
122  * @return color buffer texture 5
123  */
124  inline int32_t getColorBufferTextureId5() {
125  return colorBufferTextureId5;
126  }
127 
128  /**
129  * Initialize the geometry buffer
130  */
131  void initialize();
132 
133  /**
134  * Resize the geometry buffer
135  * @param width width
136  * @param height height
137  */
138  void reshape(int32_t width, int32_t height);
139 
140  /**
141  * Disposes this geometry buffer
142  */
143  void dispose();
144 
145  /**
146  * Enables this geometry buffer to be rendered
147  */
148  void enableGeometryBuffer();
149 
150  /**
151  * Switches back to non offscreen main frame buffer to be rendered
152  */
153  static void disableGeometryBuffer();
154 
155  /**
156  * Render to screen or bound geometry buffer
157  * @engine engine
158  * @param decalObjects decal entities
159  */
160  void renderToScreen(Engine* engine, vector<Decal*>& decalEntities);
161 
162 };
Decal entity to be used with engine class.
Definition: Decal.h:36
Engine main class.
Definition: Engine.h:131
Geometry buffer class.
void reshape(int32_t width, int32_t height)
Resize the geometry buffer.
void initialize()
Initialize the geometry buffer.
GeometryBuffer(int32_t width, int32_t height)
Public constructor.
void renderToScreen(Engine *engine, vector< Decal * > &decalEntities)
Render to screen or bound geometry buffer @engine engine.
void dispose()
Disposes this geometry buffer.
void enableGeometryBuffer()
Enables this geometry buffer to be rendered.
static void disableGeometryBuffer()
Switches back to non offscreen main frame buffer to be rendered.
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6