Ocular Engine
VertexBuffer.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_GRAPHICS_VERTEX_BUFFER__H__
19 #define __H__OCULAR_GRAPHICS_VERTEX_BUFFER__H__
20 
21 #include "Vertex.hpp"
22 #include <cstdint>
23 #include <vector>
24 
25 //------------------------------------------------------------------------------------------
26 
31 namespace Ocular
32 {
37  namespace Graphics
38  {
79  {
80  public:
81 
82  VertexBuffer();
83  virtual ~VertexBuffer();
84 
94  virtual bool build();
95 
102  virtual void bind();
103 
111  virtual void unbind();
112 
119  virtual void addVertex(Vertex const& vertex);
120 
127  virtual void addVertices(std::vector<Vertex> const& vertices);
128 
136  virtual void addVertices(std::vector<Vertex> const& vertices, uint32_t count);
137 
145  virtual void addVertices(Vertex const* vertices, uint32_t count);
146 
151  Vertex const* getVertex(uint32_t index) const;
152 
156  std::vector<Vertex> const& getVertices() const;
157 
161  uint32_t getNumVertices() const;
162 
163  protected:
164 
165  std::vector<Vertex> m_Vertices;
166 
167  private:
168  };
169  }
173 }
178 //------------------------------------------------------------------------------------------
179 
180 #endif
Definition: VertexBuffer.hpp:78
virtual void addVertices(std::vector< Vertex > const &vertices)
Definition: VertexBuffer.cpp:64
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
virtual void addVertex(Vertex const &vertex)
Definition: VertexBuffer.cpp:59
Vertex const * getVertex(uint32_t index) const
Definition: VertexBuffer.cpp:86
Definition: Vertex.hpp:43
virtual bool build()
Definition: VertexBuffer.cpp:44
virtual void unbind()
Definition: VertexBuffer.cpp:54
uint32_t getNumVertices() const
Definition: VertexBuffer.cpp:107
std::vector< Vertex > const & getVertices() const
Definition: VertexBuffer.cpp:102
virtual void bind()
Definition: VertexBuffer.cpp:49