From 3b534c013dd072d0296ebaac434e8c943ab88c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Wed, 9 Dec 2009 15:59:14 +0100 Subject: =?UTF-8?q?Beleuchtung=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 76838a2..5f24b9a 100644 --- a/main.cpp +++ b/main.cpp @@ -18,7 +18,7 @@ void initGL(bool multisample); void resize(int width, int height); void initGL(bool multisample) { - glClearColor(0.0, 0.0, 0.0, 1.0); + glClearColor(1.0, 0.85, 0.06, 1.0); glClearDepth(1.0); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); @@ -32,6 +32,16 @@ void initGL(bool multisample) { #endif resize(DEFAULT_WIDTH, DEFAULT_HEIGHT); + + glEnable(GL_LIGHTING); + static const float light[] = {-1, -1, -1, 0}; + static const float lightColor[] = {1, 1, 1, 1}; + glLightfv(GL_LIGHT0, GL_POSITION, light); + glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor); + glEnable(GL_LIGHT0); + + glEnable(GL_CULL_FACE); + glFrontFace(GL_CCW); } void resize(int width, int height) -- cgit v1.2.3