start template refactor
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#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(void* p) {
|
||||
return glewInit() == GLEW_OK;
|
||||
};
|
||||
|
||||
void render(std::list<std::function<void()>> cmdList, int& w, int& h) {
|
||||
|
||||
glViewport(0, 0, w, h);
|
||||
glClearColor(0.2, 0.2, 0.4, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
for(auto f : cmdList)
|
||||
f();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user