SparrowRenderer/sparrowrenderer.h

45 lines
969 B
C++

#ifndef SPARROWRENDERER_H
#define SPARROWRENDERER_H
#include <list>
#include <string>
class Camera;
class Module;
class SparrowRenderer
{
public:
// main methods
void initGL(int width, int height);
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();
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;
static bool modernOpenglAvailable;
std::list<ModuleNode>::iterator getModuleNode(std::string name);
};
#endif // SPARROWRENDERER_H