SoContextHandler(3)
π SoContextHandler(3) π
ok so this is a page from the Library Functions Manual, and bestie, let me tell you up front: this one's an internal class. Like, backstage pass energy only, no cap. π
β¨ NAME β¨
SoContextHandler β The SoContextHandler class is for now to be treated as an internal class.
πΈ SYNOPSIS πΈ
#include <Inventor/misc/SoContextHandler.h>
π¦ Public Types π¦
typedef void ContextDestructionCB(uint32_t contextid, void *userdata)
π 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 π
So the SoContextHandler class is, for now, to be treated as an internal class. That's the whole vibe. She's not here to be your bestie yet, she's here to do a job. π«Ά
Since
Coin 2.0
π Member Function Documentation π
π« void SoContextHandler::destructingContext (uint32_t contextid) [static]
Okay this one MATTERS. This method must be called by client code which destructs a context β and the reason is that it's the only way to guarantee there are no memory leaks upon context destruction. No leaks, periodt. π
What it does is take care of correctly freeing context-bound resources, like OpenGL texture objects and display lists. Iconic cleanup behavior honestly. π§Ήβ¨
β οΈ Before calling this function, the context must be made current. Do not skip this step, bestie, I am begging.
Also, a lil note: if you're using one of the standard GUI-binding libraries from Kongsberg Oil & Gas Technologies, this is taken care of automatically for contexts for canvases set up by SoQt, SoWin, etc. So like, if that's you, you're already slaying and you can chill. π
π« void SoContextHandler::addContextDestructionCallback (ContextDestructionCB * func, void * closure) [static]
Add a callback which will be called every single time a GL context is destructed. The callback should delete all GL resources tied to that context. That's the assignment. π
All nodes/classes that allocate GL resources should set up a callback like this. The move is: add the callback in the constructor of the node/class, and remove it in the destructor. Symmetry, we love to see it. π¦
See also
removeContextDestructionCallback()
π« void SoContextHandler::removeContextDestructionCallback (ContextDestructionCB * func, void * closure) [static]
Remove a context destruction callback. That's it, that's the function. Clean, simple, no notes. β¨
See also
addContextDestructionCallback()
π Author π
Generated automatically by Doxygen for Coin from the source code. (Yeah, Doxygen wrote this, not a person. Respect the automation. π€π )
mwah, that's the whole page bestie, hope it ate π
Coin β Version 3.1.3 β SoContextHandler(3) πΈππ¦
π¦ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.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