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

What does the first argument 0 or 1 mean for glbinding::initialize() function call in multi context application? #346

Open
asmwarrior opened this issue May 26, 2023 · 0 comments

Comments

@asmwarrior
Copy link

There is a document section Multi-Context Support, which mentions how to use multi contexts. Also multi contexts sample code are here.

In the code, I see:

GLFWwindow * window1 = glfwCreateWindow(640, 480, "", nullptr, nullptr);
if (!window1)
{
glfwTerminate();
return -1;
}
glfwSetKeyCallback(window1, key_callback);
glfwMakeContextCurrent(window1);
glbinding::initialize(0, glfwGetProcAddress, false); // only resolve functions that are actually used (lazy)
glbinding::aux::enableGetErrorCallback();
// Initialize window 2
GLFWwindow * window2 = glfwCreateWindow(640, 480, "", nullptr, nullptr);
if (!window2)
{
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window2);
glfwSetKeyCallback(window2, key_callback);
glbinding::initialize(1, glfwGetProcAddress, false); // only resolve functions that are actually used (lazy)
glbinding::aux::enableGetErrorCallback();
// print some gl infos (query)

You can see, the first argument of initialize() is either 0 or 1 for different OpenGL context. What dose the 0 and 1 mean?

Can I just use a unique int number for this argument?

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

1 participant