diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp index 3fc1711..0893849 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,15 +38,12 @@ void run() { glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT); - MC::Mesh quad({ - {-0.5f, -0.5f, 0.0f}, - {0.5f, -0.5f, 0.0f}, - {-0.5f, 0.5f, 0.0f}, + MC::Mesh shape({ + {-0.5f, -0.5f, 0.0f}, {0.5f, -0.5f, 0.0f}, + {-0.5f, 0.5f, 0.0f}, {0.5f, 0.5f, 0.0f}, + }, {0, 1, 2, 3, 2, 1}); - {0.5f, 0.5f, 0.0f}, - {-0.5f, 0.5f, 0.0f}, - {0.5f, -0.5f, 0.0f}, - }); + auto mesh = MC::Binder::load(shape); auto mesh = MC::Binder::load(quad); @@ -69,11 +66,11 @@ void run() { } void render(MC::BindableMesh& mesh) { - glClearColor(0.65f, 0.8f, 0.8f, 1.0f); + glClearColor(0.85f, 0.85f, 0.85f, 1.0f); // #DBDBDB glClear(GL_COLOR_BUFFER_BIT); mesh.bind(); - glDrawArrays(GL_TRIANGLES, 0, mesh.size()); + glDrawElements(GL_TRIANGLES, mesh.size(), GL_UNSIGNED_INT, 0); mesh.unbind(); } |
