Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
99 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

  Contents

 Introduction
 What is IM?
 Execute Buffers
 Steps to Create
 an Application

 Scene Management
 Sample App
 IM Objects
 DrawPrimitive
 Comparing Modes
 Summary

 Printable version

 


Steps to Create an Application

After the introduction to immediate mode and the concept of execute buffers, let us look at the steps needed to create an application using the immediate mode.

To create an immediate mode application, we need to create the DirectDraw and Direct3D objects required for rendering. After creating the objects, we need to set the render state. After setting the render state, we need to create the execute buffers and fill them with the appropriate data and instructions. To render the data, we need to execute the execute buffers. On executing the execute buffers, the data is taken by the rendering engine and processed, the results of which are displayed.

The steps, required to be folowed to create an immeidate mode application are shown below:

  1. Declare the variables required to store the different values and objects of the application. The variables typically store pointers to a DirectDraw object, a Direct3D object, the execute buffers, etc
  2. Initialize Windows, to create the Window on which the data is to be rendered
  3. Create the DirectDraw and the Direct3D objects, required for rendering
  4. Select an appropriate device
  5. After selecting the device, create and initialize the viewport and its parameters
  6. Set the render state of the application
  7. Setup the execute buffers. Prepare the execute buffers and fill them with the appropriate data
  8. After initializing the execute buffers, display the window and then go into an infinite loop, waiting for events to happen. When events are received, they are processed by the window event handler if they are Windows events. If there are no events to be processed, we need to render the next frame. This is done by executing the execute buffers created in a previous step




Next : Scene Management