Game Development Reference
In-Depth Information
Appendix
An Introduction to
Windows
Programming
To use the Direct3D API (application programming interface), it is nec-
essary to create a Windows (Win32) application with a main window,
upon which we render our 3D scenes. This appendix serves as an intro-
duction to writing Windows applications using the native Win32 API.
Loosely, the Win32 API is a set of low-level functions and structures
exposed to us in the C programming language that enables our applica-
tion and the Windows operating system (OS) to communicate with each
other. For example, to notify Windows to show a particular window, we
use the Win32 API function ShowWindow .
Windows programming is a huge subject, and this appendix intro-
duces only what is necessary for us to use Direct3D. For readers
interested in learning more about Windows programming with the
Win32 API, the topic Programming Windows (now in its fifth edition) by
Charles Petzold is the standard text on the subject. Another invaluable
resource when working with Microsoft technologies is the MSDN
library, which is usually included with Microsoft's Visual Studio but can
also be read online at www.msdn.microsoft.com. In general, if you come
upon a Win32 function or structure that you would like to know more
about, go to MSDN and search for that function or structure. Often in
this appendix we direct you to look up a function or structure on MSDN
for more elaborate details.
Objectives
To learn and understand the event-driven programming model used
in Windows programming
To learn the minimal code necessary to create a Windows applica-
tion that is necessary to use Direct3D
359
Search WWH ::




Custom Search