vulkan-project/shape.hpp
2022-10-07 23:30:44 +02:00

30 lines
804 B
C++

#pragma once
#include "vertex.hpp"
#include <cstdint>
namespace gz::vk {
class Shape {
public:
const std::vector<Vertex2D>& getVertices() const { return vertices; }
const std::vector<uint32_t>& getIndices() const { return indices; }
void setIndexOffset(uint32_t offset);
void setNormalize(float width, float height);
protected:
std::vector<Vertex2D> vertices;
std::vector<uint32_t> indices;
};
class Rectangle : public Shape {
public:
Rectangle(float top, float left, uint32_t width, uint32_t height, glm::vec3 color);
private:
float top, left;
uint32_t width, height;
glm::vec3 color;
void generateVertices();
};
} // namespace gz::vk