SAMPLE: Writing a Direct3D Immediate Mode Application

Last reviewed: September 5, 1997
Article ID: Q153681
4.00 WINDOWS kbprg kbgraphic kbfile kbhowto

The information in this article applies to:

  • Microsoft DirectX 2 Software Development Kit (SDK), for Windows 95

SUMMARY

Direct3D is designed to enable interactive 3D graphics on Windows. It also provides access to 3D accelerator hardware in a device-independent manner. Direct3D's Immediate Mode is Microsoft's low-level 3D API and it is ideal for developers who need to port games and other high-performance 3D applications to Windows. Direct3D's Retained Mode is built on top of Immediate Mode.

The D3D.EXE code sample is a basic Direct3D Immediate Mode application that demonstrates the steps necessary to create and render 3D objects in Direct3D Immediate Mode. This sample renders to a full screen, 8 bits-per-pixel DirectDraw surface using double buffering. Direct3D renders to the back buffer and IDirectDrawSurface::Flip() is called to update the display.

Rendering is done by using execute buffers in Immediate Mode. Execute buffers are also used to set up different states for the renderer. The D3D.EXE sample demonstrates how to set up these execute buffers with vertex data and a list of opcodes so that when interpreted, they instruct the rendering engine to produce an image. For a detailed overview of Direct3D Immediate Mode, you should view the "Immediate-Mode Overview" section of the DirectX 2 SDK help file. To find this section, go to the "Contents" tab of the Help file viewer and double-click on "Direct3D." Then double- click on "Immediate-Mode Overview" to view a list of topics.

You can find D3D.EXE (size: 29093 bytes) 
                    , a self-extracting file, on these services:

  • Microsoft's World Wide Web site on the Internet

          On the www.microsoft.com home page, click the Support icon
          Click Knowledge Base, and select the product
    
          Enter kbfile D3D.EXE (size: 29093 bytes) 
                              , and click GO!
          Open the article, and click the button to download the file
    
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the Softlib/Mslfiles folder
          Get D3D.EXE (size: 29093 bytes) 
    
  • The Microsoft Network

          On the Edit menu, click Go To, and then click Other Location
          Type "mssupport" (without the quotation marks)
          Double-click the MS Software Library icon
          Find the appropriate product area
          Locate and download D3D.EXE
    
  • Microsoft Partner Network (MSPN)

          On MSPN Desktop, double-click the Software Library icon
          Search for D3D.EXE
          Display results and download
    
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download D3D.EXE (size: 29093 bytes) 
    

    For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

       ARTICLE-ID: Q119591
       TITLE     : How to Obtain Microsoft Support Files from Online Services
    
    

    REFERENCES

    Direct3D code from portions of the OCT1 DirectX 2 sample was used in parts of the D3D.EXE sample.


  • Additional reference words: 4.00
    KBCategory: kbprg kbgraphic kbfile kbhowto
    KBSubcategory: Direct3D
    Keywords : Direct3D kbfile kbgraphic kbhowto kbprg
    Technology : kbDirectXSDK
    Version : 4.00
    Platform : WINDOWS


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: September 5, 1997
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.