Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to DirectX Implementation. Installing DirectX SDK To write and execute DirectX 9.0 programs, you need both : DirectX 9.0 runtime and the.

Similar presentations


Presentation on theme: "Introduction to DirectX Implementation. Installing DirectX SDK To write and execute DirectX 9.0 programs, you need both : DirectX 9.0 runtime and the."— Presentation transcript:

1 Introduction to DirectX Implementation

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

3 The debug option installs both the debug and retail builds of the DirectX 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 Direct3D- related debug information into the Visual Studio output window when the program is run in debug mode, which is obviously very useful when debugging DirectX applications. Installing DirectX SDK

4 Installing SDK Updates

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

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

7 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 )

8 AppWizard AppWizard creates a small C++ template application that can integrate the common DirectX components:  Direct3D,  DirectInput,  DirectMusic,  DirectSound,  DirectPlay. It provides basic functionality that is easy to build on and demonstrates the use of each component.

9 AppWizard

10

11 Let’s Try it !

12 The Basic Interface All Direct3D interfaces depends on object Direct3DRM (Retained Mode — Direct3D Retained Mode is a high-level 3-D scene graph manager that simplifies the building and animation of 3- D worlds and data ). LPDIRECT3DRM d3drm; // pointer to Direct3DRM Obj Direct3DRMCreate(&d3drm); // create & init obj The main goal of Direct3DRM is to Create other objects

13 Direct3D RM & Other Objects Direct3DRMDevice device ; // Represents the visual display destination for the renderer LPDIRECT3DRMWINDEVICE windev; device->QueryInterface(IID_IDirect3DRMWinDevice, (void**)&windev); // then can use HandlePaint() // to get use CreateDeviceFromClipper() CreateDeviceFromSurface() camera — это фрейм, определяющий местоположение и ориентацию порта просмотра

14 Direct3D RM & Other Objects camera — это фрейм, определяющий местоположение и ориентацию порта просмотра Direct3DRMViewport Defines how the 3-D scene is rendered into a 2-D window. d3drm->CreateViewport(device, camera, 0, 0, device->GetWidth(), device->GetHeight(), &viewport );

15 Direct3D RM & Other Objects camera — это фрейм, определяющий местоположение и ориентацию порта просмотра Direct3DRMFrame object used by the viewport to define the viewing position and direction LPDIRECT3DRMFRAME newframe; d3drm->CreateFrame(parentframe, &newframe);

16 Direct3D RM & Other Objects camera — это фрейм, определяющий местоположение и ориентацию порта просмотра Direct3DRMMeshBuilder Defines how the 3-D scene is rendered into a 2-D window. LPDIRECT3DRMMESHBUILDER meshbuilder; d3drm->CreateMeshBuilder(&meshbuilder);

17 Device-Supported Primitive Types Microsoft Direct3D devices can create and manipulate the following types of primitives:

18 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

19 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

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

21 DirectX Dependences Tree

22 Objects Creation Flow

23 DirectX by MFC

24 X Files 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. X files should be created by CONV3DS utility, or by Direct3D API (Direct3DRMMeshbuilder ) interface.

25 Thank You !


Download ppt "Introduction to DirectX Implementation. Installing DirectX SDK To write and execute DirectX 9.0 programs, you need both : DirectX 9.0 runtime and the."

Similar presentations


Ads by Google