ABRG-Models / morphologica

A library of supporting code for numerical modelling (JSON config, HDF5 data, Modern OpenGL visualization)
https://abrg-models.github.io/morphologica/
Apache License 2.0
255 stars 29 forks source link

Updating a visual model containing text can fail if GLFW context is not available #127

Closed optseb closed 1 year ago

optseb commented 1 year ago

In the current, non-qt branch the Fonts are obtained using the GLFW window id as part of a key into an std::map. In the main branch at the time of writing, the GLFW window id is obtained with glfwGetCurrentContext(), which may return 0x0 if there is no window context. We ran into this with drawing windows within a ros2 program. Happily, the indexing system has been redesigned in soon-to-be-merged code in branch /redesign/qtcompatibility

sebjameswml commented 1 year ago

You fix this by calling Visual::setContext() when you need the context to be available.