parent
21ad27d146
commit
dc789b2d07
@ -0,0 +1,21 @@ |
|||||||
|
#include "render.hpp" |
||||||
|
#include "config.hpp" |
||||||
|
|
||||||
|
Engine::Engine() { |
||||||
|
text.load_font(); |
||||||
|
screen.init(); |
||||||
|
framebuffer.init(); |
||||||
|
} |
||||||
|
|
||||||
|
void Engine::render() { |
||||||
|
framebuffer.begin(); |
||||||
|
|
||||||
|
glClearColor(0.1f, 0.1f, 0.1f, 1.0f); |
||||||
|
glClear(GL_COLOR_BUFFER_BIT); |
||||||
|
|
||||||
|
text.render(text_content, 25.0f, SCR_HEIGHT - text.font_size - 20, 1.0f, |
||||||
|
glm::vec3(1.0f, 1.0f, 1.0f)); |
||||||
|
|
||||||
|
framebuffer.commit(); |
||||||
|
framebuffer.draw(screen); |
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
#pragma once |
||||||
|
#include "screen.hpp" |
||||||
|
#include "framebuffer.hpp" |
||||||
|
#include "text.hpp" |
||||||
|
|
||||||
|
struct Engine { |
||||||
|
FrameBuffer framebuffer; |
||||||
|
Screen screen; |
||||||
|
std::string text_content{"Hi!"}; |
||||||
|
Text text{.font_size=202}; |
||||||
|
|
||||||
|
Engine(); |
||||||
|
|
||||||
|
void render(); |
||||||
|
}; |
||||||
Loading…
Reference in new issue