Chapter 3. Creating Your First OSG Program

This chapter demonstrates a common method to create your own OSG applications. The CMake build system, which has already been discussed in the last chapter, will be used for quickly generating solutions and makefiles on different platforms. The native memory management mechanism of OSG is also explained in detail, which is designed to avoid memory leaks at run-time, OSG also supports a refined argument parser and a debugging message notifier, both of which will be introduced.

In this chapter, we will:

  • Show how to build and run your first OSG program with the CMake tool
  • Discuss the utilization of OSG native smart pointers for automatic garbage collection and memory deallocation
  • Introduce the argument parser that will read arguments from the command line
  • Work with the message notifier tool to trace and debug OSG programs