initializing OpenGL in Video::start()
git-svn-id: svn://anubis/anaglym/trunk@34 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
639af8d59f
commit
218d292388
11
Video.cc
11
Video.cc
@ -1,5 +1,7 @@
|
|||||||
|
|
||||||
#include "Video.h"
|
#include "Video.h"
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -47,6 +49,15 @@ void Video::start(int width, int height, bool fullscreen)
|
|||||||
SDL_WM_GrabInput(SDL_GRAB_ON);
|
SDL_WM_GrabInput(SDL_GRAB_ON);
|
||||||
m_inputGrabbed = true;
|
m_inputGrabbed = true;
|
||||||
m_fullscreen = fullscreen;
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
ag.cc
2
ag.cc
@ -187,7 +187,9 @@ namespace ag
|
|||||||
int id = lua_tointeger(L, -1);
|
int id = lua_tointeger(L, -1);
|
||||||
Engine::Object * obj = g_engine->getObject(id);
|
Engine::Object * obj = g_engine->getObject(id);
|
||||||
if (obj != NULL)
|
if (obj != NULL)
|
||||||
|
{
|
||||||
obj->draw();
|
obj->draw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user