Game Development Reference
In-Depth Information
Figure 1.3: On the left we have a jagged line. On
the right we have a sampled antialiased line, which
is smoother.
The D3DMULTISAMPLE_TYPE enumerated type consists of values that
allow us to specify the level of multisampling of a surface. They are:
D3DMULTISAMPLE_NONE —Specifies no multisampling
D3DMULTISAMPLE_1_SAMPLE D3DMULTISAMPLE_16_
SAMPLE —Specifies multisampling levels from 1 to 16
There is also a quality level associated with the multisampling type.
This is described as a DWORD .
In this topic's sample programs, we do not use multisampling
because it slows down the application too much. If you wish to include
it, remember to use the IDirect3D9::CheckDeviceMultiSam-
pleType method to verify that your graphics device supports the
multisampling type that you wish to use and check for valid quality
levels.
1.3.3 Pixel Formats
We often need to specify the pixel format of Direct3D resources when
we create a surface or texture. The format of a pixel is defined by speci-
fying a member of the D3DFORMAT enumerated type. Some formats
are:
D3DFMT_R8G8B8 —Specifies a 24-bit pixel format where, starting
from the leftmost bit, 8 bits are allocated for red, 8 bits are allo-
cated for green, and 8 bits are allocated for blue
D3DFMT_X8R8G8B8 —Specifies a 32-bit pixel format where, start-
ing from the leftmost bit, 8 bits are not used, 8 bits are allocated for
red, 8 bits are allocated for green, and 8 bits are allocated for blue
D3DFMT_A8R8G8B8 —Specifies a 32-bit pixel format where, start-
ing from the leftmost bit, 8 bits are allocated for alpha, 8 bits are
allocated for red, 8 bits are allocated for green, and 8 bits are allo-
cated for blue
D3DFMT_A16B16G16R16F —Specifies a 64-bit, floating-point pixel
format. Starting from the leftmost bit, 16 bits are allocated for
alpha, 16 bits are allocated for blue, 16 bits are allocated for green,
and 16 bits are allocated for red.
Search WWH ::




Custom Search