-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsquare.hpp
More file actions
25 lines (20 loc) · 804 Bytes
/
Copy pathsquare.hpp
File metadata and controls
25 lines (20 loc) · 804 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
#pragma once
#include "UI.hpp"
#include "renderer.hpp"
#include "text.hpp"
#include <functional>
class Square : public UI
{
public:
int hasTexture = 0;
Square(Renderer &renderer, int *nextRenderingId, glm::vec3 position, std::array<glm::vec2, 2> verticesOffsets, glm::vec3 color, std::string texture = "models/couch/diffuse.png");
void initGraphics(Renderer &renderer) override;
void initGraphics(Renderer &renderer, std::string texture);
void draw(Renderer *renderer, int currentFrame, glm::mat4 transformation, glm::mat4 view, glm::mat4 projectionMatrix, VkCommandBuffer commandBuffer) override;
void cleanup(VkDevice device, Renderer &renderer) override;
private:
void initVertices();
std::array<glm::vec2, 2> verticesOffsets;
glm::vec3 color;
std::vector<Vertex> vertices;
};