parent
ccb06324c3
commit
6013283b00
@ -1,25 +1,18 @@ |
||||
#pragma once |
||||
|
||||
#include "document.hpp" |
||||
#include "shader.hpp" |
||||
|
||||
struct Image { |
||||
Shader shader{{"shaders/image.vert.glsl", "shaders/image.frag.glsl", ""}}; |
||||
unsigned int image_vao = UINT_MAX; |
||||
unsigned int image_vbo = UINT_MAX; |
||||
|
||||
float vertices[24] = { |
||||
// positions // texCoords
|
||||
-0.5f, 0.5f, 0.0f, 1.0f, // top left
|
||||
-0.5f, -0.5f, 0.0f, 0.0f, // bottom left
|
||||
0.5f, -0.5f, 1.0f, 0.0f, // bottom right
|
||||
|
||||
-0.5f, 0.5f, 0.0f, 1.0f, // top left
|
||||
0.5f, -0.5f, 1.0f, 0.0f, // bottom right
|
||||
0.5f, 0.5f, 1.0f, 1.0f, // top right
|
||||
}; |
||||
unsigned int texture_id = UINT_MAX; |
||||
int width = 0; |
||||
int height = 0; |
||||
int nrComponents = 0; |
||||
// scale, rotate, position
|
||||
|
||||
Image(); |
||||
void load(Node& node); |
||||
void render(Node& node, float xpos, float ypos, float w, float h); |
||||
void load(const std::string& filename); |
||||
void render(); |
||||
}; |
||||
|
||||
Loading…
Reference in new issue