Game Development Reference
In-Depth Information
vp = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}
Observe that we save the type of vertex processing that we are going
to use in the variable vp . This is because we are going to need to spec-
ify the vertex processing type that we are going to use later on when
we create the IDirect3DDevice9 object.
Note: The identifiers D3DCREATE_HARDWARE_VERTEXPROCESSING and
D3DCREATE_SOFTWARE_VERTEXPROCESSING are just predefined values
that denote hardware vertex processing and software vertex processing,
respectively.
Tip: When developing applications and using new, special, or
advanced features (in other words, features that are not widely sup-
ported), it is recommended that you always check the device capabilities
( D3DCAPS9 ) to see if the device supports the particular feature before
using it. Never assume that a feature is available. Also, be aware that the
sample applications in this topic generally do not follow this advice — we
generally do not check device capabilities.
Note: If a particular sample application isn't working, it is most likely
because your hardware doesn't support the feature that the sample is
using; try switching to the REF device.
1.4.3 Filling Out the D3DPRESENT_PARAMETERS
Structure
The next step in the initialization process is to fill out an instance of the
D3DPRESENT_PARAMETERS structure. This structure is used to spec-
ify some of the characteristics of the IDirect3DDevice9 object that
we are going to create, and is defined as:
typedef struct _D3DPRESENT_PARAMETERS_ {
UINT BackBufferWidth;
UINT BackBufferHeight;
D3DFORMAT BackBufferFormat;
UINT BackBufferCount;
D3DMULTISAMPLE_TYPE MultiSampleType;
DWORD MultiSampleQuality;
D3DSWAPEFFECT SwapEffect;
HWND hDeviceWindow;
BOOL Windowed;
BOOL EnableAutoDepthStencil;
D3DFORMAT AutoDepthStencilFormat;
DWORD Flags;
UINT FullScreen_RefreshRateInHz;
UINT PresentationInterval;
} D3DPRESENT_PARAMETERS;
Note: In the following data member descriptions for the
D3DPRESENT_PARAMETERS structure, we only cover the flags and
options that we feel are the most important to a beginner at this point.
Search WWH ::




Custom Search