OGLplus (0.52.0) a C++ wrapper for OpenGL

vertex_array.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_DSA_VERTEX_ARRAY_1107121519_HPP
14 #define OGLPLUS_DSA_VERTEX_ARRAY_1107121519_HPP
15 
16 #include <oglplus/vertex_array.hpp>
18 #include <oglplus/data_type.hpp>
19 
20 namespace oglplus {
21 
22 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_5 || GL_ARB_direct_state_access
23 
24 template <>
25 struct ObjGenTag<tag::DirectState, tag::VertexArray>
26 {
27  typedef tag::Create Type;
28 };
29 
31 
34 template <>
35 class ObjectOps<tag::DirectState, tag::VertexArray>
36  : public ObjZeroOps<tag::DirectState, tag::VertexArray>
37 {
38 public:
40 
45  {
46  OGLPLUS_GLFUNC(VertexArrayElementBuffer)(
47  _name,
48  GetGLName(buffer)
49  );
50  OGLPLUS_CHECK(
51  VertexArrayElementBuffer,
52  ObjectPairError,
53  Subject(buffer).
54  Object(*this)
55  );
56  return *this;
57  }
58 
60 
65  {
66  OGLPLUS_GLFUNC(EnableVertexArrayAttrib)(
67  _name,
68  GLuint(location)
69  );
70  OGLPLUS_CHECK(
71  EnableVertexArrayAttrib,
73  Object(*this).
74  Index(GLuint(location))
75  );
76  return *this;
77  }
78 
80 
85  {
86  OGLPLUS_GLFUNC(DisableVertexArrayAttrib)(
87  _name,
88  GLuint(location)
89  );
90  OGLPLUS_CHECK(
91  DisableVertexArrayAttrib,
93  Object(*this).
94  Index(GLuint(location))
95  );
96  return *this;
97  }
98 };
99 
101 typedef ObjectOps<tag::DirectState, tag::VertexArray>
103 
105 
108 typedef Object<DSAVertexArrayOps> DSAVertexArray;
109 
110 #endif // GL_ARB_direct_state_access
111 
112 } // namespace oglplus
113 
114 #endif // include guard
VertexArray wrappers.
VertexAttribSlot object.
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
Object< DSAVertexArrayOps > DSAVertexArray
An oglplus_object encapsulating the OpenGL vertex array functionality.
Definition: vertex_array.hpp:108
Implements operations applicable to any object including object 0 (zero)
Definition: fwd.hpp:157
Data type-related declarations.
Type for the vertex attribute slot (implementation-dependent limited) number.
Definition: vertex_attrib_slot.hpp:27
ObjectOps< tag::DirectState, tag::VertexArray > DSAVertexArrayOps
VertexArray operations with direct state access.
Definition: vertex_array.hpp:102
Exception class for GL object-related errors.
Definition: object.hpp:24
ObjectOps & ElementBuffer(BufferName buffer)
Bind buffer to VAO's element buffer binding point.
Definition: vertex_array.hpp:44
const ObjectOps & DisableVertexAttrib(VertexAttribSlot location)
Disable the specified vertex attribute array.
Definition: vertex_array.hpp:84
const ObjectOps & EnableVertexAttrib(VertexAttribSlot location)
Enable the specified vertex attribute array.
Definition: vertex_array.hpp:64
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).