You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
614 B
29 lines
614 B
|
5 days ago
|
#pragma once
|
||
|
|
#include "shader.hpp"
|
||
|
|
#include "config.hpp"
|
||
|
|
|
||
|
|
struct Rect {
|
||
|
|
float x = 0.0f;
|
||
|
|
float y = 0.0f;
|
||
|
|
float w = 0.0f;
|
||
|
|
float h = 0.0f;
|
||
|
|
glm::vec4 color{1.0f, 1.0f, 1.0f, 1.0f};
|
||
|
|
|
||
|
|
float vertices[6][2] = {
|
||
|
|
{ x, WINDOW_HEIGHT - y + h},
|
||
|
|
{ x, WINDOW_HEIGHT - y},
|
||
|
|
{ x + w, WINDOW_HEIGHT - y},
|
||
|
|
{ x, WINDOW_HEIGHT - y + h},
|
||
|
|
{ x + w, WINDOW_HEIGHT - y},
|
||
|
|
{ x + w, WINDOW_HEIGHT - y + h}
|
||
|
|
};
|
||
|
|
|
||
|
|
unsigned int rect_vao = UINT_MAX;
|
||
|
|
unsigned int rect_vbo = UINT_MAX;
|
||
|
|
|
||
|
|
Shader shader{{"shaders/rect.vert.glsl", "shaders/rect.frag.glsl", ""}};
|
||
|
|
|
||
|
|
void init();
|
||
|
|
void render();
|
||
|
|
};
|