OGLplus (0.52.0) a C++ wrapper for OpenGL

framebuffer.hpp
Go to the documentation of this file.
1 
14 #ifndef OGLPLUS_BOUND_FRAMEBUFFER_1107121519_HPP
15 #define OGLPLUS_BOUND_FRAMEBUFFER_1107121519_HPP
16 
17 #include <oglplus/object/bound.hpp>
18 #include <oglplus/framebuffer.hpp>
19 #include <utility>
20 
21 namespace oglplus {
22 
24 
35 template <>
36 class BoundObjOps<tag::Framebuffer>
37 {
38 private:
40 public:
42  Target target;
43 
44  BoundObjOps(void)
45  { }
46 
47  BoundObjOps(Target init_tgt)
48  : target(init_tgt)
49  { }
50 
55  {
56  return ExplicitOps::Status(
57  this->target
58  );
59  }
60 
61 
65  bool IsComplete(void) const
66  {
67  return ExplicitOps::IsComplete(
68  this->target
69  );
70  }
71 
72 
76  const BoundObjOps& HandleIncompleteError(
77  FramebufferStatus status
78  ) const
79  {
80  ExplicitOps::HandleIncompleteError(
81  this->target,
82  status
83  );
84  return *this;
85  }
86 
87 
91  const BoundObjOps& Complete(void) const
92  {
94  this->target
95  );
96  return *this;
97  }
98 
99 
103  const BoundObjOps& AttachRenderbuffer(
104  ExplicitOps::Property::Attachment attachment,
105  RenderbufferName renderbuffer
106  ) const
107  {
108  ExplicitOps::AttachRenderbuffer(
109  this->target,
110  attachment,
111  renderbuffer
112  );
113  return *this;
114  }
115 
116 
120  const BoundObjOps& AttachColorRenderbuffer(
121  FramebufferColorAttachmentNumber attachment_no,
122  RenderbufferName renderbuffer
123  ) const
124  {
125  ExplicitOps::AttachColorRenderbuffer(
126  this->target,
127  attachment_no,
128  renderbuffer
129  );
130  return *this;
131  }
132 
133 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_2
134 
138  const BoundObjOps& AttachTexture(
139  ExplicitOps::Property::Attachment attachment,
140  TextureName texture,
141  GLint level
142  ) const
143  {
144  ExplicitOps::AttachTexture(
145  this->target,
146  attachment,
147  texture,
148  level
149  );
150  return *this;
151  }
152 #endif // GL_VERSION_3_2
153 
154 
158  const BoundObjOps& AttachColorTexture(
159  FramebufferColorAttachmentNumber attachment_no,
160  TextureName texture,
161  GLint level
162  ) const
163  {
164  ExplicitOps::AttachColorTexture(
165  this->target,
166  attachment_no,
167  texture,
168  level
169  );
170  return *this;
171  }
172 
173 
177  const BoundObjOps& AttachTexture1D(
178  ExplicitOps::Property::Attachment attachment,
179  TextureTarget textarget,
180  TextureName texture,
181  GLint level
182  ) const
183  {
184  ExplicitOps::AttachTexture1D(
185  this->target,
186  attachment,
187  textarget,
188  texture,
189  level
190  );
191  return *this;
192  }
193 
194 
198  const BoundObjOps& AttachTexture2D(
199  ExplicitOps::Property::Attachment attachment,
200  TextureTarget textarget,
201  TextureName texture,
202  GLint level
203  ) const
204  {
205  ExplicitOps::AttachTexture2D(
206  this->target,
207  attachment,
208  textarget,
209  texture,
210  level
211  );
212  return *this;
213  }
214 
215 
219  const BoundObjOps& AttachTexture3D(
220  ExplicitOps::Property::Attachment attachment,
221  TextureTarget textarget,
222  TextureName texture,
223  GLint level,
224  GLint layer
225  ) const
226  {
227  ExplicitOps::AttachTexture3D(
228  this->target,
229  attachment,
230  textarget,
231  texture,
232  level,
233  layer
234  );
235  return *this;
236  }
237 
238 
242  const BoundObjOps& AttachTextureLayer(
243  ExplicitOps::Property::Attachment attachment,
244  TextureName texture,
245  GLint level,
246  GLint layer
247  ) const
248  {
249  ExplicitOps::AttachTextureLayer(
250  this->target,
251  attachment,
252  texture,
253  level,
254  layer
255  );
256  return *this;
257  }
258 
259 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_3 || GL_ARB_invalidate_subdata
260 
264  const BoundObjOps& Invalidate(
265  const EnumArray< ExplicitOps::Property::Buffer > & buffers
266  ) const
267  {
268  ExplicitOps::Invalidate(
269  this->target,
270  buffers
271  );
272  return *this;
273  }
274 #endif // GL_VERSION_4_3 GL_ARB_invalidate_subdata
275 
276 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_3 || GL_ARB_invalidate_subdata
277 
281  const BoundObjOps& Invalidate(
282  GLsizei count,
283  const ExplicitOps::Property::Buffer * buffers
284  ) const
285  {
286  ExplicitOps::Invalidate(
287  this->target,
288  count,
289  buffers
290  );
291  return *this;
292  }
293 #endif // GL_VERSION_4_3 GL_ARB_invalidate_subdata
294 
295 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_3 || GL_ARB_invalidate_subdata
296 
300  const BoundObjOps& Invalidate(
301  const EnumArray< ExplicitOps::Property::Buffer > & buffers,
302  GLint x,
303  GLint y,
304  GLsizei width,
305  GLsizei height
306  ) const
307  {
308  ExplicitOps::Invalidate(
309  this->target,
310  buffers,
311  x,
312  y,
313  width,
314  height
315  );
316  return *this;
317  }
318 #endif // GL_VERSION_4_3 GL_ARB_invalidate_subdata
319 
320 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_3 || GL_ARB_invalidate_subdata
321 
325  const BoundObjOps& Invalidate(
326  GLsizei count,
327  const ExplicitOps::Property::Buffer * buffers,
328  GLint x,
329  GLint y,
330  GLsizei width,
331  GLsizei height
332  ) const
333  {
334  ExplicitOps::Invalidate(
335  this->target,
336  count,
337  buffers,
338  x,
339  y,
340  width,
341  height
342  );
343  return *this;
344  }
345 #endif // GL_VERSION_4_3 GL_ARB_invalidate_subdata
346 
347 
348 }; // class BoundObjOps
349 
350 } // namespace oglplus
351 
352 #endif // include guard
FramebufferStatus
Framebuffer status enumeration.
Definition: framebuffer_status.hpp:24
const BoundObjOps & AttachColorRenderbuffer(FramebufferColorAttachmentNumber attachment_no, RenderbufferName renderbuffer) const
Definition: framebuffer.hpp:120
const BoundObjOps & Complete(void) const
Definition: framebuffer.hpp:91
Type for the framebuffer color attachment (implementation-dependent) number.
Definition: framebuffer_attachment.hpp:23
const BoundObjOps & AttachTextureLayer(ExplicitOps::Property::Attachment attachment, TextureName texture, GLint level, GLint layer) const
Definition: framebuffer.hpp:242
Class wrapping framebuffer functions with explicit target selector.
Definition: framebuffer.hpp:150
bool IsComplete(void) const
Definition: framebuffer.hpp:65
Framebuffer object wrappers.
TextureTarget
Texture bind and image specification targets.
Definition: texture_target.hpp:27
const BoundObjOps & Invalidate(GLsizei count, const ExplicitOps::Property::Buffer *buffers, GLint x, GLint y, GLsizei width, GLsizei height) const
Definition: framebuffer.hpp:325
const BoundObjOps & Invalidate(const EnumArray< ExplicitOps::Property::Buffer > &buffers, GLint x, GLint y, GLsizei width, GLsizei height) const
Definition: framebuffer.hpp:300
const BoundObjOps & AttachTexture2D(ExplicitOps::Property::Attachment attachment, TextureTarget textarget, TextureName texture, GLint level) const
Definition: framebuffer.hpp:198
Operations on currently bound objects.
FramebufferStatus Status(void) const
Definition: framebuffer.hpp:54
FramebufferTarget
Framebuffer bind target.
Definition: framebuffer_target.hpp:24
const BoundObjOps & AttachColorTexture(FramebufferColorAttachmentNumber attachment_no, TextureName texture, GLint level) const
Definition: framebuffer.hpp:158
const BoundObjOps & Invalidate(GLsizei count, const ExplicitOps::Property::Buffer *buffers) const
Definition: framebuffer.hpp:281
const BoundObjOps & AttachTexture1D(ExplicitOps::Property::Attachment attachment, TextureTarget textarget, TextureName texture, GLint level) const
Definition: framebuffer.hpp:177
Object< FramebufferOps > Framebuffer
An oglplus_object encapsulating the framebuffer object functionality.
Definition: framebuffer.hpp:733
A common template for "named" objects like textures, buffers, etc.
Definition: fwd.hpp:136
const BoundObjOps & HandleIncompleteError(FramebufferStatus status) const
Definition: framebuffer.hpp:76
const BoundObjOps & AttachRenderbuffer(ExplicitOps::Property::Attachment attachment, RenderbufferName renderbuffer) const
Definition: framebuffer.hpp:103
const BoundObjOps & AttachTexture3D(ExplicitOps::Property::Attachment attachment, TextureTarget textarget, TextureName texture, GLint level, GLint layer) const
Definition: framebuffer.hpp:219
const BoundObjOps & AttachTexture(ExplicitOps::Property::Attachment attachment, TextureName texture, GLint level) const
Definition: framebuffer.hpp:138
const BoundObjOps & Invalidate(const EnumArray< ExplicitOps::Property::Buffer > &buffers) const
Definition: framebuffer.hpp:264

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).