DXUT Basics
with Examples in C++
Prof. David Bernstein
James Madison University
Computer Science Department
bernstdh@jmu.edu
Introduction
What is DXUT?
A utility API that simplifies the proecss of creating MS-Windows applications that use Direct3D
Alternatives:
Work with the MS-Windows API directly
The Process (in
WinMain
)
Register the display callback function
Initialize DXUT
Create the window
Create the device (i.e., the rendering engine)
Start event processing
Clean-up before exiting
Initialization
directx9examples/dxut/window/window.cpp (Fragment: init)
Keyboard Callback
The Callback
directx9examples/dxut/window/window.cpp (Fragment: keyboardcallback)
Registration
directx9examples/dxut/window/window.cpp (Fragment: register-keyboard)
Mouse Callback
The Callback
directx9examples/dxut/window/window.cpp (Fragment: mousecallback)
Registration
directx9examples/dxut/window/window.cpp (Fragment: register-mouse)
Device-Related Callbacks
directx9examples/dxut/window/window.cpp (Fragment: register-device)
Starting the Event-Loop
directx9examples/dxut/window/window.cpp (Fragment: event-loop)
A Complete Example
That Does Nothing
directx9examples/dxut/window/window.cpp
There's Always More to Learn