Introduction to Direct X Implementation Installing Direct X

  • Slides: 25
Download presentation
Introduction to Direct. X Implementation

Introduction to Direct. X Implementation

Installing Direct. X SDK l To write and execute Direct. X 9. 0 programs,

Installing Direct. X SDK l To write and execute Direct. X 9. 0 programs, you need both : l Direct. X 9. 0 runtime and the l Direct. X 9. 0 SDK (Software Development Kit) l Note that the runtime will be installed when you install the SDK. The Direct. X SDK can be obtained at http: //msdn. microsoft. com l The installation is straightforward; however, there is one important point, make sure that you select the debug option.

Installing Direct. X SDK The debug option installs both the debug and retail builds

Installing Direct. X SDK The debug option installs both the debug and retail builds of the Direct. X DLLs onto your computer, whereas the retail option installs just the retail DLLs. For development, you want the debug DLLs, since these DLLs will output Direct 3 Drelated debug information into the Visual Studio output window when the program is run in debug mode, which is obviously very useful when debugging Direct. X applications.

Installing SDK Updates

Installing SDK Updates

Setting Up the Development Environment Include Search Paths Tools-> Options-> Directories tab. In VC

Setting Up the Development Environment Include Search Paths Tools-> Options-> Directories tab. In VC ++ 6. 0 and 7. 0 you will also want to specify the directory paths at which the Direct. X header files and library files are located, so VC ++ can find these files. The Direct. X header files and library files are located at the paths D: DXSDKInclude and D: DXSDKLib, respectively. Note The location of the Direct. X directory DXSDK on your computer may differ; it depends on the location that you specified during installation.

Preparing for Compilation Linker Search Paths In order to build the sample programs, you

Preparing for Compilation Linker Search Paths In order to build the sample programs, you will need to link the library files d 3 d 9. lib, d 3 dx 9. lib, and winmm. lib into your project. Note that winmm. lib isn't a Direct. X library file; it is the Windows multimedia library file, and we use for its timer functions

Why use C++? Language: Delphi, VB , C# , C++ , Java , C

Why use C++? Language: Delphi, VB , C# , C++ , Java , C Aspects : 1. Unmanaged against managed 2. VB is Interpreter 3. Java – Virtual machine 4. Com supporting (C++ supports COM better than C does )

App. Wizard creates a small C++ template application that can integrate the common Direct.

App. Wizard creates a small C++ template application that can integrate the common Direct. X components: ØDirect 3 D, ØDirect. Input, ØDirect. Music, ØDirect. Sound, ØDirect. Play. It provides basic functionality that is easy to build on and demonstrates the use of each component.

App. Wizard

App. Wizard

App. Wizard

App. Wizard

Let’s Try it !

Let’s Try it !

The Basic Interface All Direct 3 D interfaces depends on object Direct 3 DRM

The Basic Interface All Direct 3 D interfaces depends on object Direct 3 DRM (Retained Mode — Direct 3 D Retained Mode is a high-level 3 -D scene graph manager that simplifies the building and animation of 3 D worlds and data ). LPDIRECT 3 DRM d 3 drm; // pointer to Direct 3 DRM Obj Direct 3 DRMCreate(&d 3 drm); // create & init obj The main goal of Direct 3 DRM is to Create other objects

Direct 3 D RM & Other Objects Direct 3 DRMDevice device ; // Represents

Direct 3 D RM & Other Objects Direct 3 DRMDevice device ; // Represents the visual display destination for the renderer // to get use Create. Device. From. Clipper() Create. Device. From. Surface() LPDIRECT 3 DRMWINDEVICE windev; device->Query. Interface(IID_IDirect 3 DRMWin. Device, (void**)&windev); // then can use Handle. Paint() camera — это фрейм, определяющий местоположение и ориентацию порта просмотра

Direct 3 D RM & Other Objects Direct 3 DRMViewport Defines how the 3

Direct 3 D RM & Other Objects Direct 3 DRMViewport Defines how the 3 -D scene is rendered into a 2 -D window. d 3 drm->Create. Viewport( device, camera, 0, 0, device->Get. Width(), device->Get. Height(), &viewport ); camera — это фрейм, определяющий местоположение и ориентацию порта просмотра

Direct 3 D RM & Other Objects Direct 3 DRMFrame object used by the

Direct 3 D RM & Other Objects Direct 3 DRMFrame object used by the viewport to define the viewing position and direction LPDIRECT 3 DRMFRAME newframe; d 3 drm->Create. Frame(parentframe, &newframe); camera — это фрейм, определяющий местоположение и ориентацию порта просмотра

Direct 3 D RM & Other Objects Direct 3 DRMMesh. Builder Defines how the

Direct 3 D RM & Other Objects Direct 3 DRMMesh. Builder Defines how the 3 -D scene is rendered into a 2 -D window. LPDIRECT 3 DRMMESHBUILDER meshbuilder; d 3 drm->Create. Mesh. Builder(&meshbuilder); camera — это фрейм, определяющий местоположение и ориентацию порта просмотра

Device-Supported Primitive Types l Microsoft Direct 3 D devices can create and manipulate the

Device-Supported Primitive Types l Microsoft Direct 3 D devices can create and manipulate the following types of primitives:

Device-Supported Primitive Types A point list is a collection of vertices that are rendered

Device-Supported Primitive Types A point list is a collection of vertices that are rendered as isolated points A line list is a list of isolated, straight line segments. The number of vertices in a line list must be an even number greater than or equal to two.

Device-Supported Primitive Types A line strip is a primitive that is composed of connected

Device-Supported Primitive Types A line strip is a primitive that is composed of connected line segments A triangle list is a list of isolated triangles. A triangle list must have at least three vertices.

Device-Supported Primitive Types A triangle strip is a series of connected triangles A triangle

Device-Supported Primitive Types A triangle strip is a series of connected triangles A triangle fan is similar to a triangle strip, except that all the triangles share one vertex

Direct. X Dependences Tree

Direct. X Dependences Tree

Objects Creation Flow

Objects Creation Flow

Direct. X by MFC

Direct. X by MFC

X Files l X files provide a template-driven format that enables the storage of

X Files l X files provide a template-driven format that enables the storage of meshes, textures, animations, and user-definable objects. Support for animation sets enables you to store predefined paths for playback in real time. l X files should be created by CONV 3 DS utility, or by Direct 3 D API (Direct 3 DRMMeshbuilder ) interface.

Thank You !

Thank You !