SoContextHandler(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– SoContextHandler(3) πŸ’–

okay bestie, welcome to the Coin manual, section 3 β€” and today's main character is SoContextHandler. ✨


🌸 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) β€” the callback signature, she's a typedef and she's doing her best πŸ’…

🌈 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 whole vibe. no cap. πŸ™ˆ

Since β€” Coin 2.0 ⭐


πŸ’œ Member Function Documentation πŸ’œ

πŸ’… void SoContextHandler::destructingContext (uint32_t contextid) [static]

Bestie, listen β€” this method must be called by client code that destructs a context, so that there are no memory leaks upon context destruction. like, it's not optional, it's the law. 😭

It'll take care of correctly freeing all your context-bound resources β€” think OpenGL texture objects and display lists β€” and honestly? iconic of her. πŸ‘‘

⚠️ Before you call this function, the context must be made current. do not skip this step I am begging πŸ™

Also note: if you're using one of the standard GUI-binding libraries from Kongsberg Oil & Gas Technologies, this is all taken care of automatically for contexts for canvases set up by SoQt, SoWin, etc. so you can just vibe. 🧚


🌟 void SoContextHandler::addContextDestructionCallback (ContextDestructionCB * func, void * closure) [static]

Add a callback which will get called every single time a GL context is destructed. πŸ’€ The callback should delete all GL resources tied to that context, no crumbs left behind.

All nodes/classes that allocate GL resources should set up a callback like this β€” add the callback in the constructor of the node/class, and remove it in the destructor. that's the whole lifecycle, periodt. ✨

See also β€” removeContextDestructionCallback()


πŸ“ void SoContextHandler::removeContextDestructionCallback (ContextDestructionCB * func, void * closure) [static]

Remove a context destruction callback. bye bestie, it was real 🫢

See also β€” addContextDestructionCallback()


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Coin from the source code. (she wrote herself, main character energy fr fr 🌈)


and that's the whole page!! mwah πŸ’– Version 4.0.10, dated Thu Jun 25 2026 00:00:00 β€” shoutout to SoContextHandler(3), you ate and left no notes. πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from