oglplus icon indicating copy to clipboard operation
oglplus copied to clipboard

Using glBindings

Open kestrelm opened this issue 8 years ago • 1 comments

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

kestrelm avatar Jul 22 '16 19:07 kestrelm

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();
  ...
}

matus-chochlik avatar Jul 23 '16 05:07 matus-chochlik