Introduction%20to%20DirectX%20Implementation - PowerPoint PPT Presentation

About This Presentation
Title:

Introduction%20to%20DirectX%20Implementation

Description:

Note that the runtime will be installed when you install the SDK. ... Note that winmm.lib isn't a DirectX library file; it is the Windows multimedia ... – PowerPoint PPT presentation

Number of Views:193
Avg rating:3.0/5.0
Slides: 26
Provided by: mashag
Category:

less

Transcript and Presenter's Notes

Title: Introduction%20to%20DirectX%20Implementation


1
Introduction to DirectXImplementation
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
  • The installation is straightforward however,
    there is one important point, make sure that you
    select the debug option.

3
Installing DirectX SDK
  • 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.

4
Installing SDK Updates
5
Setting Up the Development Environment
Include Search Paths Tools-gt Options-gt
Directories tab.
  • 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.

6
Preparing for Compilation
Linker Search Paths
  • 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

7
Why use C?
  • Language
  • Delphi, VB , C , C , Java , C
  • Aspects
  • Unmanaged against managed
  • VB is Interpreter
  • Java Virtual machine
  • 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
AppWizard
11
Lets 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
// to get use CreateDeviceFromClipper()
CreateDeviceFromSurface()
LPDIRECT3DRMWINDEVICE windev device-gtQueryInter
face(IID_IDirect3DRMWinDevice, (void)windev)
// then can use HandlePaint()
camera  ??? ?????, ???????????? ?????????????? ?
?????????? ????? ?????????
14
Direct3D RM Other Objects
Direct3DRMViewport Defines how the 3-D scene is
rendered into a 2-D window.
d3drm-gtCreateViewport( device, camera, 0,
0, device-gtGetWidth(),
device-gtGetHeight(), viewport )
camera  ??? ?????, ???????????? ?????????????? ?
?????????? ????? ?????????
15
Direct3D RM Other Objects
Direct3DRMFrame object used by the viewport to
define the viewing position and direction
LPDIRECT3DRMFRAME newframe d3drm-gtCreateFrame(p
arentframe, newframe)
camera  ??? ?????, ???????????? ?????????????? ?
?????????? ????? ?????????
16
Direct3D RM Other Objects
Direct3DRMMeshBuilder Defines how the 3-D scene
is rendered into a 2-D window.
LPDIRECT3DRMMESHBUILDER meshbuilder
d3drm-gtCreateMeshBuilder(meshbuilder)
camera  ??? ?????, ???????????? ?????????????? ?
?????????? ????? ?????????
17
Device-Supported Primitive Types
  • Microsoft Direct3D devices can create and
    manipulate the following types of primitives

18
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.
19
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.
20
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
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 !
Write a Comment
User Comments (0)
About PowerShow.com