From 218d29238816d00f28936329ac81e3b1037c7954 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 27 Sep 2009 21:22:50 +0000 Subject: [PATCH] initializing OpenGL in Video::start() git-svn-id: svn://anubis/anaglym/trunk@34 99a6e188-d820-4881-8870-2d33a10e2619 --- Video.cc | 11 +++++++++++ ag.cc | 2 ++ 2 files changed, 13 insertions(+) diff --git a/Video.cc b/Video.cc index 7ebc981..acad7fa 100644 --- a/Video.cc +++ b/Video.cc @@ -1,5 +1,7 @@ #include "Video.h" +#include +#include #include #include using namespace std; @@ -47,6 +49,15 @@ void Video::start(int width, int height, bool fullscreen) SDL_WM_GrabInput(SDL_GRAB_ON); m_inputGrabbed = true; m_fullscreen = fullscreen; + + glEnable(GL_DEPTH_TEST); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, (double) width / (double) height, 0.01, 10000.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); } } diff --git a/ag.cc b/ag.cc index 9a15fc9..325033d 100644 --- a/ag.cc +++ b/ag.cc @@ -187,7 +187,9 @@ namespace ag int id = lua_tointeger(L, -1); Engine::Object * obj = g_engine->getObject(id); if (obj != NULL) + { obj->draw(); + } } lua_pop(L, 1); }