Game Development Reference
In-Depth Information
does not support shaders, you can still test the sample code with the
REF device. It is important to understand that the REF device is for
development only. It ships only with the DirectX SDK and cannot be
distributed to end users. In addition, the REF is slow enough that it's
not practical to use for anything but testing.
1.1.2 D3DDEVTYPE
In code, a HAL device is specified by D3DDEVTYPE_HAL , which is a
member of the D3DDEVTYPE enumerated type. Similarly, a REF device
is specified by D3DDEVTYPE_REF , which is also a member of the
D3DDEVTYPE enumerated type. These types are important to remem-
ber because we will be asked to specify which type to use when
creating our device.
1.2 COM
Component Object Model (COM) is the technology that allows DirectX
to be language independent and have backward compatibility. We usu-
ally refer to a COM object as an interface, which for our purposes can
be thought of and used as a C++ class. Most of the details of COM are
transparent to us when programming DirectX with C++. The only
thing that we must know is that we obtain pointers to COM interfaces
through special functions or the methods of another COM interface; we
do not create a COM interface with the C++ new keyword. In addition,
when we are done with an interface, we call its Release method (all
COM interfaces inherit functionality from the IUnknown COM inter-
face, which provides the Release method) rather than delete it.
COM objects perform their own memory management.
There is, of course, much more to COM, but more detail is not nec-
essary for using DirectX effectively.
Note: COM interfaces are prefixed with a capital I . For example,
the COM interface that represents a surface is called
IDirect3DSurface9 .
1.3 Some Preliminaries
The initialization process of Direct3D requires us to be familiar with
some basic graphics concepts and Direct3D types. We introduce these
ideas and types in this section, making the next section that discusses
Direct3D initialization more focused.
Search WWH ::




Custom Search