45 lines
718 B
C++
45 lines
718 B
C++
#if RENDERER == 1
|
|
|
|
#ifndef RENDERER_OPENGL
|
|
#define 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
|
|
|
|
#endif
|