Game Development Reference
In-Depth Information
D3DVERTEXBUFFER_DESC vbDescription;
_vertexBuffer->GetDesc(&vbDescription); // get vb info
D3DINDEXBUFFER_DESC ibDescription;
_indexBuffer->GetDesc(&ibDescription); // get ib info
The D3DVERTEXBUFFER_DESC and D3DINDEXBUFFER_DESC struc-
tures are defined as follows:
typedef struct _D3DVERTEXBUFFER_DESC {
D3DFORMAT Format;
D3DRESOURCETYPE Type;
DWORD Usage;
D3DPOOL Pool;
UINT Size;
DWORD FVF;
} D3DVERTEXBUFFER_DESC;
typedef struct _D3DINDEXBUFFER_DESC {
D3DFORMAT Format;
D3DRESOURCETYPE Type;
DWORD Usage;
D3DPOOL Pool;
UINT Size;
} D3DINDEXBUFFER_DESC;
3.2 Render States
Direct3D encapsulates a variety of rendering states that affect how
geometry is rendered. Render states have default values, so you only
need to change them if your application requires something other than
the default. A render state stays in effect until you change the particu-
lar state again. To set a render state, we use the following method:
HRESULT IDirect3DDevice9::SetRenderState(
D3DRENDERSTATETYPE State, // the state to change
DWORD Value
// value of the new state
);
For example, in this chapter's samples we are going to render our
objects in wireframe mode. Therefore, we set the following render
state:
_device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
Note: Look up D3DRENDERSTATETYPE in the DirectX SDK to see all
the possible render states.
Search WWH ::




Custom Search