51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
#ifndef SPARROWRENDERER_H
|
|
#define SPARROWRENDERER_H
|
|
|
|
#include <list>
|
|
#include <string>
|
|
|
|
class Camera;
|
|
class Module;
|
|
class Scene;
|
|
|
|
class SparrowRenderer
|
|
{
|
|
public:
|
|
// main methods
|
|
void initGL(int width, int height, bool forceCrappy = false);
|
|
void destroyGL();
|
|
void resizeGL(int width, int height);
|
|
void renderGL();
|
|
static bool isModernOpenGLAvailable();
|
|
|
|
// modules methods
|
|
void addModule(Module* myModule, std::string name);
|
|
int getNbModules();
|
|
|
|
// camera methods
|
|
void setCamera(Camera* myCamera);
|
|
Camera* getCamera();
|
|
|
|
// scene methods
|
|
void setScene(Scene* myScene);
|
|
Scene* getScene();
|
|
|
|
protected:
|
|
typedef struct s_moduleNode{
|
|
Module* module;
|
|
std::string name;
|
|
bool isEnabled;
|
|
|
|
s_moduleNode(Module* myModule, const std::string &myName) : module(myModule), name(myName), isEnabled(true) {}
|
|
} ModuleNode;
|
|
|
|
Camera* camera;
|
|
Scene* scene;
|
|
std::list<ModuleNode> modules;
|
|
static bool modernOpenglAvailable;
|
|
|
|
std::list<ModuleNode>::iterator getModuleNode(std::string name);
|
|
};
|
|
|
|
#endif // SPARROWRENDERER_H
|