56 lines
1.3 KiB
C++
56 lines
1.3 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;
|
|
std::vector<dGeomID> m_geoms;
|
|
|
|
void draw() { glCallList(display_list); }
|
|
void loadPhy(const std::string & path,
|
|
bool static_data = false);
|
|
};
|
|
|
|
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
|