diff options
author | Constantin Riß <constantin.riss@dre.de> | 2009-12-09 15:59:14 +0100 |
---|---|---|
committer | Constantin Riß <constantin.riss@dre.de> | 2009-12-09 15:59:14 +0100 |
commit | 3b534c013dd072d0296ebaac434e8c943ab88c14 (patch) | |
tree | 13e3d7315ccc816a2b9d07a58e98655618177b03 /main.cpp | |
parent | 482852aceacb54879c08e6fffc909a2cc160d483 (diff) | |
download | c3d-3b534c013dd072d0296ebaac434e8c943ab88c14.tar c3d-3b534c013dd072d0296ebaac434e8c943ab88c14.zip |
Beleuchtung hinzugefügt
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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) |