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

Example from the documentation on context initialization causes stack overflow #406

Open
andesyv opened this issue Mar 7, 2022 · 0 comments

Comments

@andesyv
Copy link

andesyv commented Mar 7, 2022

In the Initialize Contexts section of the documentation it states you can sync OpenGL contexts using glbinding by doing:

glbinding::Binding::addContextSwitchCallback([](glbinding::ContextHandle handle) {
    setContext(handle);
});

And then do

glbinding::Binding::useContext(handle);

to notify globjects and glbinding of the switch. But in source/globjects/source/globjects.cpp#L177 it looks like globjects::setContext(glbinding::ContextHandle handle) calls glbinding::Binding::useContext(glbinding::ContextHandle handle) internally, causing an infinite call chain and a stack overflow.

Just removing the section is probably enough to fix this, but it would be nice if it also explicitly states that the init, setContext and setCurrentContext globject functions also internally calls the glbinding equivalents.

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