-
Book Overview & Buying
-
Table Of Contents
OpenSceneGraph 3.0: Beginner's Guide
In a typical programming scenario, the developer should create a pointer to the root node, which directly or indirectly manages all other child nodes of the scene graph. In that case, the application will traverse the scene graph and delete each node and its internal data carefully when they no longer need to be rendered. This process is tiresome and error-prone, debugging dozens of bad trees and wild pointers, because developers can never know how many other objects still keep a pointer to the one being deleted. However without writing the management code, data segments occupied by all scene nodes will never be deleted, which will lead to unexpected memory leaks.
This is why memory management is important in OSG programming. A basic concept of memory management always involves two topics:
Allocation: Providing the memory needed by an object, by allocating the required memory block.
Deallocation: Recycling the allocated memory for reuse, when its data is no...
Change the font size
Change margin width
Change background colour