diff options
Diffstat (limited to 'MatchBloxEngine/MatchBloxEngine/main.cpp')
-rw-r--r-- | MatchBloxEngine/MatchBloxEngine/main.cpp | 10 |
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;
|