summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
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)