Chapter 9. Interacting with Outside Elements
OSG provides a graphical user interface (GUI) abstraction library that centralizes the commonality of implementations of different windowing systems (MFC, Qt, GLUT, and so on). It handles GUI events, among which the most commonly seen is the user's real-time interaction with peripheral devices such as the mouse and keyboard. In addition, the osgViewer library encapsulates different windowing systems' graphics contexts for constructing rendering environments. These constitute the topic of this chapter: how OSG interacts with other elements—for instance, input devices and windowing systems.
In this chapter, we will tell you:
How to handle keyboard and mouse events with customized event handlers
How to create and handle user-defined events
How to understand the intersection test of scene objects
How to configure traits of a window, and thus create the graphical context
How to integrate the rendered scene into a windowing system