32 lines
775 B
C++
32 lines
775 B
C++
|
/** The most basic renderer — a stupid glut application */
|
||
|
|
||
|
#include "../Mesh.hpp"
|
||
|
#include <set>
|
||
|
|
||
|
class GlutRender {
|
||
|
public:
|
||
|
static GlutRender& get_instance();
|
||
|
|
||
|
GlutRender(GlutRender const&) = delete;
|
||
|
void operator=(GlutRender const&) = delete;
|
||
|
|
||
|
void init(int* argc, char** argv,
|
||
|
int wid, int hei, const char* win_name);
|
||
|
void cleanup();
|
||
|
void add_mesh(const Mesh* mesh);
|
||
|
void remove_mesh(const Mesh* mesh);
|
||
|
void run();
|
||
|
|
||
|
private: //meth
|
||
|
GlutRender();
|
||
|
|
||
|
protected:
|
||
|
void reshape(int wid, int hei);
|
||
|
void display();
|
||
|
|
||
|
static void reshape_handle(int wid, int hei);
|
||
|
static void display_handle();
|
||
|
private:
|
||
|
std::set<const Mesh*> meshes;
|
||
|
};
|