Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using glBindings #132

Open
kestrelm opened this issue Jul 22, 2016 · 1 comment
Open

Using glBindings #132

kestrelm opened this issue Jul 22, 2016 · 1 comment
Assignees

Comments

@kestrelm
Copy link

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

@matus-chochlik matus-chochlik self-assigned this Jul 23, 2016
@matus-chochlik
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants