Docsity

DirectX: A Comprehensive Guide to Microsoft's Collection of APIs for Multimedia and Gaming, Slides of Multimedia Applications

Partial preview of the text

Download DirectX: A Comprehensive Guide to Microsoft's Collection of APIs for Multimedia and Gaming and more Slides Multimedia Applications in PDF only on Docsity!

DirectX

Table of contents

 Introduction  History of DirectX  DirectX components  DirectX Graphics – DirectDraw  DirectX Graphics - Direct3D  DirectInput  DirectPlay  DirectSound - DirectSound3D  DirectMusic  DirectSetup  DirectX Media  DirectX Media Objects  Future of DirectX  Any questions?

History of DirectX

 Programmers continued to make games to DOS  Microsoft wanted games for Windows -> DirectX development was started  Became very popular among game developers  Version 9.0 in use, version 10 will be published with Windows Vista

DirectX components

 First only DirectDraw, DirectSound, DirectInput, and DirectPlay in Games SDK  Nowadays 9 components  DirectX Graphics - DirectDraw  DirectX Graphics - Direct3D  DirectInput  DirectPlay  DirectSound - DirectSound3D  DirectMusic  DirectSetup  DirectX Media  DirectX Media Objects

DirectX Graphics - Direct3D

 3D API

 First version with DirectX 2.  Full screen /windowed mode  New versions support the latest technology available on 3D graphics cards  Competitor to OpenGL

Direct3D (DirectX 9.0) Code Sample

void loadTexture ( void ) { D3DXCreateTextureFromFile( g_pd3dDevice, "woodfloor.bmp", &g_pTexture ); g_pd3dDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); g_pd3dDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); } Example source: http://www.codesampler.com/dx9src/dx9src_3.htm#dx9_texture

DirectInput Keyboard Handling Code Sample Imports Microsoft.DirectX Imports Microsoft.DirectX.DirectInput.CooperativeLevelFlags Imports Microsoft.DirectX.DirectInput Public Class Form Inherits System.Windows.Forms.Form Dim KB As New DirectInput.Device(DirectInput.SystemGuid.Keyboard) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load KB.SetCooperativeLevel(Me, Background Or NonExclusive) Me.Show() KB.Acquire() End Sub Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing KB.Dispose() KB = Nothing End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim State As DirectInput.KeyboardState State = KB.GetCurrentKeyboardState If State.Item(Key.Escape) Then Me.Close() If State.Item(Key.A) Then Label1.Text &= "a" If State.Item(Key.B) Then Label1.Text &= "b" If State.Item(Key.C) Then Label1.Text &= "c" End Sub End Class Example Source: http://gpwiki.org/index.php/DirectX:DirectInput:Tutorials:VBNET:DX9:Keyboard_Handling

DirectPlay

 For network communication of games  Three primary interfaces  IDirectPlay8Server  IDirectPlay8Client  IDirectPlay8Peer  Will not be used after Windows XP  Replaced by Xbox Live technology

DirectMusic

 Higher-level than DirectSound  Support for dynamic soundtracks  DirectMusic first came in 1999 with DirectX 6.

DirectSetup

 Not a real API  Very simple library of functions  For installing DirectX  Supports checking the existing version number of DirectX

DirectX Media Objects

 DMOs are COM-based multimedia and data-streaming components  Like DirectShow filters but simpler  Take input data to produce output data which are multimedia framework components

Future of DirectX

 Version 10 coming with Windows Vista  Components will keep changing  DirectInput replaced with XInput  DirectSound replaced with XACT  DirectShow replaced with Media Foundation  Etc..  DirectMusic will probably not be changed

References

 "An Introduction to DirectX": http://people.msoe.edu/~barnicks/courses/cs384/papers9899/veldhuizen.pdf  "Games Programming with Java and Java 3D": http://fivedots.coe.psu.ac.th/~ad/jg/intro/  "The Direct3D 10 system": http://doi.acm.org/10.1145/1141911.  "What 3D API for Java should I use and why?": http://doi.acm.org/10.1145/258734.  "A multi-Api course in computer graphics": http://portal.acm.org/citation.cfm?id=378669&coll=ACM&dl=ACM&CFID= 6 1&CFTOKEN=  Official DirectX documentation (Microsoft): http://msdn.microsoft.com/library/default.asp?url=/library/en- us/dnanchor/html/anch_DirectX.asp  DirectX From Wikipedia, the free encyclopedia: http://en.wikipedia.org/wiki/DirectX