more memory stuff

This commit is contained in:
2026-02-20 18:42:03 +00:00
parent 3db30fee6e
commit 3d211b5da3
4 changed files with 64 additions and 14 deletions

View File

@@ -1,22 +1,38 @@
#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:
CveModel();
~CveModel();
class CveModel {
public:
CveModel(const CveModel &) = delete;
CveModel &operator=(const CveModel &) = delete;
struct Vertex {
glm::vec2 position;
static std::vector<VkVertexInputBindingDescription> getBindingDescriptions();
static std::vector<VkVertexInputAttributeDescription> getAttributeDescriptions();
};
void bind(VkCommandBuffer commandBuffer);
void draw(VkCommandBuffer commandBuffer);
private:
CveDevice &cveDevice;
VkBuffer vertexBuffer;
VkDeviceMemory vertexBufferMemory;
uint32_t vertexCount;
};
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;
};
}