-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.hpp
More file actions
38 lines (29 loc) · 846 Bytes
/
Copy pathModel.hpp
File metadata and controls
38 lines (29 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include "Device.hpp"
#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/glm.hpp>
#include <vector>
namespace engine {
class Model {
public:
struct Vertex {
glm::vec2 position;
glm::vec3 color;
static std::vector<VkVertexInputBindingDescription> getBindingDescriptions();
static std::vector<VkVertexInputAttributeDescription> getAttributeDescriptions();
};
Model(Device& device, const std::vector<Vertex>& vertices);
~Model();
Model(const Model&) = delete;
Model& operator=(const Model&) = delete;
void bind(VkCommandBuffer commandBuffer);
void draw(VkCommandBuffer commandBuffer);
private:
void createVertexBuffers(const std::vector<Vertex>& vertices);
Device& m_device;
VkBuffer vertexBuffer;
VkDeviceMemory vertexBufferMemory;
uint32_t vertexCount;
};
}