This commit is contained in:
2025-09-20 20:57:29 -05:00
parent 90c3b6149e
commit bdf18fffd3
27 changed files with 704 additions and 7 deletions

View File

@@ -8,12 +8,19 @@
using namespace Dawn;
MeshVertex vertices[3] = {
{ Color4B::RED, glm::vec2(0.0f, 0.0f), glm::vec3(-0.5f, -0.5f, 0.0f) },
{ Color4B::GREEN, glm::vec2(1.0f, 0.0f), glm::vec3(0.5f, -0.5f, 0.0f) },
{ Color4B::BLUE, glm::vec2(0.5f, 1.0f), glm::vec3(0.0f, 0.5f, 0.0f) }
};
Display::Display(Engine &engine) :
#if DAWN_SDL2
glContext(nullptr),
window(nullptr),
#endif
engine(engine)
engine(engine),
mesh(3, PrimitiveType::Triangles, vertices)
{
#if DAWN_SDL2
uint32_t flags = SDL_INIT_VIDEO;
@@ -99,7 +106,17 @@ void Display::update(void) {
SDL_GL_MakeCurrent(this->window, this->glContext);
glViewport(0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(
Color4F::CORNFLOWER_BLUE.r,
Color4F::CORNFLOWER_BLUE.g,
Color4F::CORNFLOWER_BLUE.b,
Color4F::CORNFLOWER_BLUE.a
);
mesh.draw(0, -1);
// glViewport(0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT);
SDL_GL_SwapWindow(this->window);
#endif