41 lines
689 B
C++
41 lines
689 B
C++
#ifdef RENDERER_OPENGL
|
|
#undef RENDERER_OPENGL
|
|
|
|
#include "pch.hpp"
|
|
|
|
#define GLEW_STATIC
|
|
#include <GL/glew.h>
|
|
|
|
|
|
namespace Archimedes {
|
|
|
|
class RendererOpenGL {
|
|
|
|
public:
|
|
typedef void renderCmd();
|
|
|
|
RendererOpenGL() {};
|
|
~RendererOpenGL() {};
|
|
|
|
bool init() {
|
|
return glewInit() == GLEW_OK;
|
|
};
|
|
|
|
void render(std::list<std::function<void()>> cmdList, int& w, int& h) {
|
|
|
|
glViewport(0, 0, w, h);
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
|
for(auto f : cmdList)
|
|
f();
|
|
}
|
|
};
|
|
|
|
typedef RendererOpenGL RendererImpl;
|
|
|
|
|
|
}
|
|
|
|
#endif
|