SimpleGL  1.1.0
A framework for platform independent rendering
vertex_buffer.hpp
Go to the documentation of this file.
1 
8 #ifndef VERTEX_BUFFER_HPP
9 #define VERTEX_BUFFER_HPP
10 
11 #include <SimpleGL_vk/SimpleGL_vk_Export.h>
12 
13 #include <vector>
14 
15 #include <vulkan/vulkan.h>
16 
17 #include <glm/glm.hpp>
18 
19 namespace sgl {
20 
26  class SIMPLEGL_VK_EXPORT VertexBuffer {
27 
28  private:
30  VkBuffer handle;
31 
33  VkDeviceMemory memory;
34 
35  public:
41  VertexBuffer(uint32_t size);
42 
44  ~VertexBuffer(void);
45 
51  VkBuffer getHandle();
52 
58  void upload(std::vector<float> data);
59 
65  void upload(std::vector<glm::vec2> data);
66 
72  void upload(std::vector<glm::vec3> data);
73 
79  void upload(std::vector<glm::vec4> data);
80  };
81 
87  class SIMPLEGL_VK_EXPORT UniformBuffer {
88 
89  private:
91  VkBuffer handle;
92 
94  VkDeviceMemory memory;
95 
96  public:
102  UniformBuffer(uint32_t size);
103 
105  ~UniformBuffer(void);
106 
112  VkBuffer getHandle();
113 
119  void upload(std::vector<glm::mat2> data);
120 
126  void upload(std::vector<glm::mat3> data);
127 
133  void upload(std::vector<glm::mat4> data);
134  };
135 }
136 
137 #endif /* VERTEX_BUFFER_HPP */
Generic namespace for the SimpleGL framework.
Definition: application.hpp:18
This class wraps a Vulkan vertex buffer.
This class wraps a Vulkan uniform buffer.