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