Setting up the Windows Environment
The Rmmain.cpp file in the samples provded with this SDK is used as a basis for all of the Retained-Mode samples. This file contains the standard Windows framework of initialization, setting up a message loop, and creating a window procedure for message processing, but it also does some work that is specific to Direct3D Retained-Mode applications:
·It enumerates the current Direct3D device drivers. This is described in the Enumerating Direct3D Device Drivers section.
·It creates the Retained-Mode API, the scene and camera frames, and a DirectDrawClipper object. This is described in the Initialization section.
·It creates a Direct3DRM device and viewport. This is described in the Creating a Direct3DRM Device and Viewport section.
·It sets the rendering quality, dithering flag, texture quality, shades, default texture colors, and default texture shades. This is described in the Setting the Render State section.
·It calls a locally defined BuildScene function to set up the lights and visuals in a scene. This is described in the Setting Up the Virtual Environment section.
·It renders the scene. This is described in the Rendering into a Viewport section.
·It makes the mouse status available to sample applications. This is described in the OverrideDefaults and ReadMouse section.