summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorConstantin Riß <constantin.riss@dre.de>2009-12-09 15:59:14 +0100
committerConstantin Riß <constantin.riss@dre.de>2009-12-09 15:59:14 +0100
commit3b534c013dd072d0296ebaac434e8c943ab88c14 (patch)
tree13e3d7315ccc816a2b9d07a58e98655618177b03 /main.cpp
parent482852aceacb54879c08e6fffc909a2cc160d483 (diff)
downloadc3d-3b534c013dd072d0296ebaac434e8c943ab88c14.tar
c3d-3b534c013dd072d0296ebaac434e8c943ab88c14.zip
Beleuchtung hinzugefügt
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp12
1 files changed, 11 insertions, 1 deletions
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)