oglplus
oglplus copied to clipboard
Using glBindings
Hello,
How should one go about using glBinding ( https://github.com/cginternals/glbinding ) as the extension loading library for oglplus in place of glew?
Thanks
Hi,
I didn't try OGLplus with GL bindings yet (and it is not supported in the build system), but generally you should include the glBinding headers /before/ any oglplus headers and call the glBinding initialization code before calling any oglplus functions or creating oglplus GL-object-related classes:
#include <glbinding/gl/gl.h>
#include <glbinding/Binding.h>
#include <oglplus/all.hpp>
using namespace gl;
int main()
{
// create context, e.g. using GLFW, Qt, SDL, GLUT, ...
glbinding::Binding::initialize();
oglplus::Context ctx;
ctx.ClearColor(1.0, 0.0, 0.0, 0.0);
ctx.Clear().ColorBuffer();
...
}