Chapter 12

Carefully blocking threads

The getContent() method is located in the text's update callback, so it will be called every frame while rendering. addContent() is always called when the thread is running and the user is providing input via the console. That means that the conflict of these two methods can occur all the time. Without a mutex or other protections, we can never determine what will happen (it may work for a while, receive unexpected characters sometime, or even crash).

Number of created levels and files

The total number of rows/columns is 1024, and the final number of each cell is 64. As every quad-tree cell can be replaced with 2x2 sub-cells while going nearer, we can easily deduce the size of cells in each level:

  • Level 0 is 1024x1024 ...

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.