OGLplus (0.52.0) a C++ wrapper for OpenGL

transform_feedback.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_DSA_TRANSFORM_FEEDBACK_1107121519_HPP
14 #define OGLPLUS_DSA_TRANSFORM_FEEDBACK_1107121519_HPP
15 
17 #include <oglplus/object/name.hpp>
18 
19 namespace oglplus {
20 
21 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_5 || GL_ARB_direct_state_access
22 
23 template <>
24 struct ObjGenTag<tag::DirectState, tag::TransformFeedback>
25 {
26  typedef tag::Create Type;
27 };
28 
30 
33 template <>
34 class ObjectOps<tag::DirectState, tag::TransformFeedback>
35  : public ObjZeroOps<tag::DirectState, tag::TransformFeedback>
36 {
37 protected:
38  ObjectOps(void){ }
39 public:
40  GLint GetIntParam(GLenum query) const;
41  GLint GetIntParam(GLenum query, GLuint index) const;
42  GLint64 GetInt64Param(GLenum query, GLuint index) const;
43 
44  bool Active(void) const
45  {
46  return GetIntParam(GL_TRANSFORM_FEEDBACK_ACTIVE) == GL_TRUE;
47  }
48 
49  bool Paused(void) const
50  {
51  return GetIntParam(GL_TRANSFORM_FEEDBACK_PAUSED) == GL_TRUE;
52  }
53 
54  ObjectOps& BufferBase(GLuint index, BufferName buffer)
55  {
56  OGLPLUS_GLFUNC(TransformFeedbackBufferBase)(
57  _name,
58  index,
59  GetGLName(buffer)
60  );
61  OGLPLUS_CHECK(
62  TransformFeedbackBufferBase,
63  ObjectPairError,
64  Subject(buffer).
65  Object(*this).
66  Index(index)
67  );
68  return *this;
69  }
70 
71  ObjectOps& BufferRange(
72  GLuint index,
73  BufferName buffer,
74  BufferSize offset,
75  BufferSize size
76  )
77  {
78  OGLPLUS_GLFUNC(TransformFeedbackBufferRange)(
79  _name,
80  index,
81  GetGLName(buffer),
82  GLintptr(offset.Get()),
83  GLsizeiptr(size.Get())
84  );
85  OGLPLUS_CHECK(
86  TransformFeedbackBufferRange,
87  ObjectPairError,
88  Subject(buffer).
89  Object(*this).
90  Index(index)
91  );
92  return *this;
93  }
94 
95  BufferName BufferBinding(GLuint index) const
96  {
97  return BufferName(GetIntParam(
98  GL_TRANSFORM_FEEDBACK_BUFFER_BINDING,
99  index
100  ));
101  }
102 
103  GLint64 BufferStart(GLuint index) const
104  {
105  return GetInt64Param(
106  GL_TRANSFORM_FEEDBACK_BUFFER_START,
107  index
108  );
109  }
110 
111  GLint64 BufferSize(GLuint index) const
112  {
113  return GetInt64Param(
114  GL_TRANSFORM_FEEDBACK_BUFFER_SIZE,
115  index
116  );
117  }
118 };
119 
123 
125 
128 typedef Object<DSATransformFeedbackOps> DSATransformFeedback;
129 
130 #endif // GL_ARB_direct_state_access
131 
132 } // namespace oglplus
133 
134 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
135 #include <oglplus/dsa/transform_feedback.ipp>
136 #endif // OGLPLUS_LINK_LIBRARY
137 
138 #endif // include guard
ObjectOps< tag::DirectState, tag::TransformFeedback > DSATransformFeedbackOps
TransformFeedback operations with direct state access.
Definition: transform_feedback.hpp:122
TransformFeedback object wrappers.
This class represents the size of a GPU buffer in bytes.
Definition: buffer_size.hpp:22
TRANSFORM_FEEDBACK_BUFFER.
Implements operations applicable to named (non-zero) objects.
Definition: wrap_tpl.hpp:45
GLuint GetGLName(ObjectName< ObjTag > named)
Returns the GLuint OpenGL name assigned to named object.
Definition: name.hpp:38
Class wrapping transform feedback-related functionality with direct state access. ...
Definition: transform_feedback.hpp:34
Implements operations applicable to any object including object 0 (zero)
Definition: fwd.hpp:157
GLsizeiptr Get(void) const
Gets the size in bytes.
Definition: buffer_size.hpp:58
Object< DSATransformFeedbackOps > DSATransformFeedback
An oglplus_object encapsulating the OpenGL transform feedback functionality.
Definition: transform_feedback.hpp:128
Base class for OpenGL "named" objects.
A common template for "named" objects like textures, buffers, etc.
Definition: fwd.hpp:136

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).