Skip to content

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

@andesyv

Description

@andesyv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions