Immediate Mode ObjectsAs compared to the object in the retained mode, the number of objects provided by the immediate mode, are not many. A large number of object provided by the retained mode are convenience objects, which help in the management of the 3D data at hand. In the immediate mode, all the functionality provided by the retained mode object has to be provided by the application, using the execute buffers. The objects provided by immediate mode are sufficient to manage 3D data, but some additional amount of work will have to be done by the application. Some of the objects provided by immediate mode are described in the following subsections. IDirect3DDevice Used to interface to a DirectDrawSurface object. A device object, has its own list of execute buffers, viewports, textures and materials. As we have mentioned before, only textures and materials can be shared across devices. An execute buffer is owned by only one viewport and a viewport is owned by only one device at a time. This object provides methods to report the hardware capabilities of the system. It also provides methods to manage the textures and execute buffers, like maintaining the list of texture, manipulating the matrix objects and executing the execute buffers. IDirect3DTexture Used to interface to the DirectDrawSurface object. This object is used to provide a texture handle, which is used in materials and the execute and z buffer for a viewport. This object is also used to load an unload textures and handle changes in palettes. The different aspects that can be changed using this object are:
IDirect3DMaterial Used to control the material properties of an object. It contains the colour and possibly a texture handle. The material handle can be used inside the execute buffers or can be used to set the background of a viewport. IDirect3DLight Used to create and manipulate light sources and their properties. IDirect3DViewport Used to represent the region on which the scene is rendered. IDirect3DExecuteBuffer Used to store the execute buffer information, namely the data and the instructions for the execute buffer. The execute buffer is filled with two arrays, one being the vertex list and the other being the opcodes and their data elements. The opcode array follows the vertex array. Sample Images In this section, we present some sample screens, of a few immediate mode applications, in figure 20. Figure 20: Sample Image For more details about the immediate mode, refer [2], [3], [1], [9].
|
|||||||||||