1 directx cis 487/587 bruce r. maxim um-dearborn
TRANSCRIPT
![Page 1: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/1.jpg)
1
DirectX
CIS 487/587
Bruce R. Maxim
UM-Dearborn
![Page 2: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/2.jpg)
2
DirectX and Win32
• Win32 Application– GDI
• Windows Device Driver Interface
– DirectX• DirectX Graphics (DirectDraw/Direct3D)• DirectX Audio (DirectSound/DirectSound3D/DirectMusic)• DirectInput• DirectPlay• DirectSetup• DirectShow
![Page 3: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/3.jpg)
3
DirectX
• Contains a run-time library consisting of several .dll’s that you may distribute with your application
• There are several .lib and .h files that make-up the development library
• You need to be sure that you know where these files are housed
• DirectX is backward compatible
![Page 4: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/4.jpg)
4
COM
• COM allows DirectX to work with multiple programming languages
• COM objects can be shipped with an application as .dll’s
• COM object provide interfaces to hardware objects
• COM objects are loaded dynamically• You can add functionality to an installed
application simply by updating the COM object
![Page 5: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/5.jpg)
5
DCOM
• An advanced version of COM
• Allows applications to access DCOM objects on networked machines
![Page 6: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/6.jpg)
6
DirectX ArchitectureWin32 App
Win GDI
Win DDI
HW Audio, Video, Input, Storage, …
DirectX
HEL: HW Emulation Layer
HAL: HW Abstraction Layer
![Page 7: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/7.jpg)
7
HAL and HEL
• HAL– Lowest level of software– Consists of manufacturer’s device drivers– DirectX figures out the COM interface needed
• HEL– Built on top of HAL– Allows emulation of missing hardware (e.g.
program still runs whether 3D graphics accelerator card is present or not)
![Page 8: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/8.jpg)
8
COM Interfaces
• The process of creating a COM interface is described in the text
• You do not need to create your own COM interfaces if you use DirectX
• DirectX provides wrappers round the COM stuff
![Page 9: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/9.jpg)
9
Creating COM Interfaces
• You begin by deriving an interface class from IUnknown (COM base class)
• Every derived class inherits 3 methods– QueryInterface( ) – used to request pointer
to interface– AddRef( ) – used to increase reference
count for COM object– Release( ) – decrements COM object
reference counter
![Page 10: 1 DirectX CIS 487/587 Bruce R. Maxim UM-Dearborn](https://reader036.vdocument.in/reader036/viewer/2022082817/56649dce5503460f94ac18ef/html5/thumbnails/10.jpg)
10
Creating COM Interfaces
• Basic technique is to create pointers to each device specific function and equate them to a generic function pointer
• DirectX will then be able to use the correct COM object when its function is referenced