From 59fe611e6ee06f8e9445f1b19339a1f158c9322c Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Fri, 13 Feb 2015 10:04:58 +0100 Subject: [PATCH] enable backface culling --- src/app.cpp | 1 + src/init.cpp | 4 ++++ src/init.hpp | 1 + 3 files changed, 6 insertions(+) diff --git a/src/app.cpp b/src/app.cpp index 051a5f0..3de246c 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -39,6 +39,7 @@ Application::Application() , up(false) , down(false) { GLContext::EnableVSync(); + GLContext::EnableBackfaceCulling(); program.LoadShader( GL_VERTEX_SHADER, "#version 330 core\n" diff --git a/src/init.cpp b/src/init.cpp index 4772898..40f76de 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -142,6 +142,10 @@ void GLContext::EnableVSync() { } } +void GLContext::EnableBackfaceCulling() { + glEnable(GL_CULL_FACE); +} + InitGLEW::InitGLEW() { glewExperimental = GL_TRUE; diff --git a/src/init.hpp b/src/init.hpp index a2f2de7..51ab3f8 100644 --- a/src/init.hpp +++ b/src/init.hpp @@ -83,6 +83,7 @@ public: GLContext &operator =(const GLContext &) = delete; static void EnableVSync(); + static void EnableBackfaceCulling(); private: SDL_GLContext handle; -- 2.39.2