summaryrefslogtreecommitdiffstats
path: root/MatchBloxEngine/MatchBloxEngine/main.cpp
diff options
context:
space:
mode:
authorDennis Peeten <dpeeten@onsneteindhoven.nl>2008-05-06 19:38:37 (GMT)
committerDennis Peeten <dpeeten@onsneteindhoven.nl>2008-05-06 19:38:37 (GMT)
commit177fd758a25e954a43c20e59e6e61ba15a661c44 (patch)
treee65059265b6abf4177833f9b7f54d8e04c91953d /MatchBloxEngine/MatchBloxEngine/main.cpp
parentd205c9a71a2d3d415cb470c0c148a7541a18ab41 (diff)
download2iv55-177fd758a25e954a43c20e59e6e61ba15a661c44.zip
2iv55-177fd758a25e954a43c20e59e6e61ba15a661c44.tar.gz
2iv55-177fd758a25e954a43c20e59e6e61ba15a661c44.tar.bz2
Diffstat (limited to '')
-rw-r--r--MatchBloxEngine/MatchBloxEngine/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/MatchBloxEngine/MatchBloxEngine/main.cpp b/MatchBloxEngine/MatchBloxEngine/main.cpp
index 0ddf8eb..9ec7f1c 100644
--- a/MatchBloxEngine/MatchBloxEngine/main.cpp
+++ b/MatchBloxEngine/MatchBloxEngine/main.cpp
@@ -12,13 +12,14 @@ C_MatchBloxEngine *g_pEngine;
void init_gl(void)
{
+ GLfloat l_fLightpos[4] = {0.0, 1.0, 1.0, 0.0};
glClearColor(0.9, 0.9, 0.9, 1.0);
glClearDepth(1000.0);
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
- //glEnable(GL_COLOR_MATERIAL);
+ glLightfv(GL_LIGHT0, GL_POSITION, l_fLightpos);
glEnable(GL_NORMALIZE);
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
@@ -35,7 +36,7 @@ void render_scene(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- g_pEngine->Render(1000);
+ g_pEngine->Render(glutGet(GLUT_ELAPSED_TIME));
glutSwapBuffers();
@@ -62,6 +63,11 @@ void process_normal_keys(unsigned char key, int x, int y)
}
else
{
+ if (key == 'n')
+ {
+ g_pEngine->Abort();
+ g_pEngine->NewGame(0, 0, BS_LARGE);
+ }
msgStruct l_msg;
l_msg.m_MessageType = KEY_PRESS;
l_msg.parm1 = key;