anaglym/anaglym.h
Josh Holtrop 639af8d59f added Engine::Object and ag::object::load; filled in ag::loadModel a bit more
git-svn-id: svn://anubis/anaglym/trunk@33 99a6e188-d820-4881-8870-2d33a10e2619
2009-09-27 21:01:40 +00:00

53 lines
1.2 KiB
C++

#ifndef ANAGLYM_H
#define ANAGLYM_H
#include <string>
#include <lua.hpp>
#include <map>
#include "Video.h"
#include "OdeWorld/OdeWorld.h"
#include "wfobj/WFObj.hh"
#define FILENAME_SAFE_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"
class Engine
{
public:
class Object
{
public:
WFObj * wfobj;
GLuint display_list;
void draw() { glCallList(display_list); }
};
Engine();
~Engine();
std::string locateResource(const std::string & shortname);
Video * getVideo() { return m_video; }
bool load(const char * program);
void run();
void reportErrors(int status);
OdeWorld & getWorld() { return m_world; }
int addObject(WFObj * obj);
Object * getObject(int id);
protected:
void registerLibraries();
bool fileExists(const std::string & path);
lua_State * m_luaState;
Video * m_video;
std::string m_program_path;
OdeWorld m_world;
std::map<int, Object *> m_objects;
int m_next_object_index;
};
extern Engine * g_engine;
#endif