mpri-graphics-project/render/GlutRender.hpp

34 lines
771 B
C++
Raw Normal View History

/** The most basic renderer — a stupid glut application */
2018-02-06 19:07:07 +01:00
#pragma once
#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();
2018-02-06 21:05:45 +01:00
void add_mesh(Mesh* mesh);
void remove_mesh(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:
2018-02-06 21:05:45 +01:00
std::set<Mesh*> meshes;
};