SoContextHandler(3)
π SoContextHandler(3) π
Library Functions Manual Β· the Coin crew said hi and also this page exists β¨
πΈ NAME πΈ
SoContextHandler β okay so bestie, for now this class is literally to be treated as an internal class. That's the whole vibe. Not for you. Yet. π
π SYNOPSIS π
#include <Inventor/misc/SoContextHandler.h>
π¦ Public Types
typedef void ContextDestructionCB(uint32_t contextid, void *userdata)β the callback shape, slay
π Static Public Member Functions
static void destructingContext (uint32_t contextid)static void addContextDestructionCallback (ContextDestructionCB *func, void *closure)static void removeContextDestructionCallback (ContextDestructionCB *func, void *closure)
β¨ Detailed Description β¨
The SoContextHandler class is, for now, to be treated as an internal class. That's it, that's the description, we're keeping it real fr fr. π
Since : Coin 2.0 β
π Member Function Documentation π
π void SoContextHandler::destructingContext (uint32_t contextid) [static]
So like, this method must be called by client code that destructs a context β mandatory, no skips β to guarantee that there are no memory leaks upon context destruction. Leaks are not the vibe. π
This will take care of correctly freeing context-bound resources, like OpenGL texture objects and display lists. Iconic behaviour honestly.
β οΈ Before calling this function, the context must be made current. Do not forget this part bestie, it's giving important.
Also note: if you're using one of the standard GUI-binding libraries from Systems in Motion, this is taken care of automatically for contexts for canvases set up by SoQt, SoWin, etc. So you can just chill. π«Ά
References: SbList< Type >::getArrayPtr(), and SbList< Type >::getLength().
π void SoContextHandler::addContextDestructionCallback (ContextDestructionCB *func, void *closure) [static]
Add a callback which will be called every time a GL context is destructed. The callback should delete all GL resources tied to that context. Clean up after yourself, main character energy. π§Ήβ¨
All nodes/classes that allocate GL resources should set up a callback like this. The way to do it: add the callback in the constructor of the node/class, and remove it in the destructor. Balanced. Symmetrical. We love to see it. π
See also: removeContextDestructionCallback()
π void SoContextHandler::removeContextDestructionCallback (ContextDestructionCB *func, void *closure) [static]
Remove a context destruction callback. Goodbye callback, you did great. π
See also: addContextDestructionCallback()
β Author β
Generated automatically by Doxygen for Coin from the source code. Not a human, just a robot doing its lil thing. π€π
and that's the whole page bestie, hope it slayed πΈπ¦β¨
Coin Β· Version 2.5.0 Β· SoContextHandler(3) β mwah, take care of your contexts π
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms