54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
#ifndef SPARROWRENDERER_H
|
|
#define SPARROWRENDERER_H
|
|
|
|
#include <list>
|
|
#include <string>
|
|
#include "camera.h"
|
|
|
|
class Module;
|
|
|
|
class SparrowRenderer
|
|
{
|
|
public:
|
|
// main methods
|
|
void initGL(int width, int height);
|
|
void destroyGL();
|
|
void resize(int width, int height);
|
|
void render();
|
|
|
|
// modules methods
|
|
void addModule(Module* myModule, std::string name);
|
|
void addModule(Module* myModule, std::string name, int index);
|
|
void removeModule(std::string name);
|
|
void removeModule(int index);
|
|
Module* getModule(std::string name);
|
|
Module* getModule(int index);
|
|
int getNbModules();
|
|
std::string getModuleName(int index);
|
|
void enableModule(std::string name);
|
|
void enableModule(int index);
|
|
void disableModule(std::string name);
|
|
void disableModule(int index);
|
|
bool isModuleEnabled(std::string name);
|
|
bool isModuleEnabled(int index);
|
|
|
|
// camera methods
|
|
Camera* getCamera();
|
|
|
|
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;
|
|
std::list<ModuleNode> modules;
|
|
|
|
std::list<ModuleNode>::iterator getModuleNode(std::string name);
|
|
};
|
|
|
|
#endif // SPARROWRENDERER_H
|