40 lines
960 B
C++
40 lines
960 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include "cve_device.hpp"
|
|
|
|
#define GLM_FORCE_RADIANS
|
|
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
|
|
#include <glm/glm.hpp>
|
|
|
|
namespace cve {
|
|
class CveModel {
|
|
public:
|
|
|
|
struct Vertex {
|
|
glm::vec2 position;
|
|
glm::vec3 color;
|
|
|
|
static std::vector<VkVertexInputBindingDescription> getBindingDescriptions();
|
|
static std::vector<VkVertexInputAttributeDescription> getAttributeDescriptions();
|
|
};
|
|
|
|
CveModel(CveDevice &device, const std::vector<Vertex> &verticies);
|
|
~CveModel();
|
|
|
|
CveModel(const CveModel &) = delete;
|
|
CveModel &operator=(const CveModel &) = delete;
|
|
|
|
void bind(VkCommandBuffer commandBuffer);
|
|
void draw(VkCommandBuffer commandBuffer);
|
|
|
|
private:
|
|
void createVertexBuffers(const std::vector<Vertex> &verticies);
|
|
|
|
CveDevice &cveDevice;
|
|
VkBuffer vertexBuffer;
|
|
VkDeviceMemory vertexBufferMemory;
|
|
uint32_t vertexCount;
|
|
};
|
|
} |