206
Appendix B: Cosmo 3D Sample Application
Creating the User Interface
csWindow encapsulates the user interface: it includes the methods you use to construct
a window in which a Cosmo 3D application runs. csWindow manages a csContext object
to control the graphics context as well as a csEvent object that handles user actions, like
mouse events.
csWindow is replete with default values that satisfy most application needs. cube.cxx, for
example, uses all of the default values except for the title of the window, which is
specified with the InitWindow() method.
Cosmo 3D also allows you to construct your own window using X window code. This
option gives you complete control over the look and functionality of the window.
For a complete description of csWindow and using X window code, see Chapter 12,
“User Interface Mechanisms.”
Rendering World Space
To render a scene graph, the csDrawAction::apply() method is applied to the root node
of the scene graph, as follows:
da->apply(root);
where da is a csDrawAction object.