D3D9::Device Class Reference

Rendering device which maintains render states, resources such as vertex buffers, textures and shaders, and is able to draw primitives. More...

#include <dx9_wrap.h>

List of all members.

Public Member Functions

 Device (HWND hWnd, bool bFullScreen)
 Create device object and tie it to given Window handle.

void BeginScene ()
 Call this before rendering the scene.

void EndScene ()
 Call this after you have rendered the whole scene.

void Clear (DWORD flags=D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR color=D3DCOLOR_XRGB(0x9F, 0x9F, 0x9F), float zvalue=1.0f, DWORD stencil=0, const D3DRECT *pRects=NULL)
 Call this to clear screen before rendering the scene.

void Present ()
 Call this after EndScene() to swap internal buffer and window contents, essentially presenting drawn frame on the screen to the user.

void SetFVF (DWORD fvf)
 The legacy "SetFVF()" call.

void DrawPrimitive (D3DPRIMITIVETYPE type, UINT StartVertex, UINT PrimitiveCount)
 Call this to draw set of triangles.

void DrawIndexedPrimitive (D3DPRIMITIVETYPE type, INT BaseVertex, UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
 Call this to draw set of indexed triangles.

void SetRenderState (D3DRENDERSTATETYPE state, DWORD value)
 Set D3D render state.

void SetVertexShaderConstantF (UINT StartRegister, CONST FLOAT *pConstantData, UINT Vector4fCount)
 Set vertex shader constant (parameter) register(s) from the FLOAT bank of constants.

void SetVertexShaderConstantI (UINT StartRegister, CONST INT *pConstantData, UINT Vector4iCount)
 Set vertex shader constant (parameter) register(s) from the INT bank of constants.

void SetVertexShaderConstantB (UINT StartRegister, CONST BOOL *pConstantData, UINT Vector4bCount)
 Set vertex shader constant (parameter) register(s) from the BOOL bank of constants.

void SetPixelShaderConstantF (UINT StartRegister, CONST FLOAT *pConstantData, UINT Vector4fCount)
 Set pixel shader constant (parameter) register(s) from the FLOAT bank of constants.

void SetPixelShaderConstantI (UINT StartRegister, CONST INT *pConstantData, UINT Vector4iCount)
 Set pixel shader constant (parameter) register(s) from the INT bank of constants.

void SetPixelShaderConstantB (UINT StartRegister, CONST BOOL *pConstantData, UINT Vector4bCount)
 Set pixel shader constant (parameter) register(s) from the BOOL bank of constants.


Detailed Description

Rendering device which maintains render states, resources such as vertex buffers, textures and shaders, and is able to draw primitives.

This is the most important object involved in 3D rendering using D3D9_wrapper library.


Constructor & Destructor Documentation

D3D9::Device::Device HWND  hWnd,
bool  bFullScreen
 

Create device object and tie it to given Window handle.

Specify bFullScreen=true if you wish the window to expand to full screen.

Todo:
Add ability to construct Device object with full range of options allowed by raw D3D: Depth buffer bpp, Color buffer bpp, FullScreen, and everything included in struct D3DPRESENT_PARAMETERS (from raw D3D), etc.


Member Function Documentation

void D3D9::Device::BeginScene  ) 
 

Call this before rendering the scene.

void D3D9::Device::EndScene  ) 
 

Call this after you have rendered the whole scene.

void D3D9::Device::Clear DWORD  flags = D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,
D3DCOLOR  color = D3DCOLOR_XRGB(0x9F, 0x9F, 0x9F),
float  zvalue = 1.0f,
DWORD  stencil = 0,
const D3DRECT *  pRects = NULL
 

Call this to clear screen before rendering the scene.

Note:
this method may be safely called either before or after BeginScene()

void D3D9::Device::Present  ) 
 

Call this after EndScene() to swap internal buffer and window contents, essentially presenting drawn frame on the screen to the user.

void D3D9::Device::SetFVF DWORD  fvf  ) 
 

The legacy "SetFVF()" call.

Note:
For modern applications, this was superceded by so called "VertexDeclaration" (see D3D9::VertexFormat class).

Todo:
Because this function is obsolete and can be fully emulated using VertexDeclaration class, I'm considering to remove it from the interface in the future, because this relic function only clutters the Device interface and do not conform to recommended way of setting vertex declaration for DX9.

void D3D9::Device::DrawPrimitive D3DPRIMITIVETYPE  type,
UINT  StartVertex,
UINT  PrimitiveCount
 

Call this to draw set of triangles.

void D3D9::Device::DrawIndexedPrimitive D3DPRIMITIVETYPE  type,
INT  BaseVertex,
UINT  MinIndex,
UINT  NumVertices,
UINT  StartIndex,
UINT  PrimitiveCount
 

Call this to draw set of indexed triangles.

void D3D9::Device::SetRenderState D3DRENDERSTATETYPE  state,
DWORD  value
 

Set D3D render state.

void D3D9::Device::SetVertexShaderConstantF UINT  StartRegister,
CONST FLOAT *  pConstantData,
UINT  Vector4fCount
 

Set vertex shader constant (parameter) register(s) from the FLOAT bank of constants.

void D3D9::Device::SetVertexShaderConstantI UINT  StartRegister,
CONST INT *  pConstantData,
UINT  Vector4iCount
 

Set vertex shader constant (parameter) register(s) from the INT bank of constants.

void D3D9::Device::SetVertexShaderConstantB UINT  StartRegister,
CONST BOOL *  pConstantData,
UINT  Vector4bCount
 

Set vertex shader constant (parameter) register(s) from the BOOL bank of constants.

void D3D9::Device::SetPixelShaderConstantF UINT  StartRegister,
CONST FLOAT *  pConstantData,
UINT  Vector4fCount
 

Set pixel shader constant (parameter) register(s) from the FLOAT bank of constants.

void D3D9::Device::SetPixelShaderConstantI UINT  StartRegister,
CONST INT *  pConstantData,
UINT  Vector4iCount
 

Set pixel shader constant (parameter) register(s) from the INT bank of constants.

void D3D9::Device::SetPixelShaderConstantB UINT  StartRegister,
CONST BOOL *  pConstantData,
UINT  Vector4bCount
 

Set pixel shader constant (parameter) register(s) from the BOOL bank of constants.


The documentation for this class was generated from the following files:
Generated on Sun May 1 17:34:20 2005 for RealityStrike Game Engine API by doxygen 1.3.6