Data Structures | |
class | N3DDEVICE |
Interface to the 3D hardware. More... | |
Functions | |
void | N3DDEVICE::BeginScene () |
Begins a scene. | |
void | N3DDEVICE::Clear (const unsigned _flags, const N3DCOLOR &_color, const N3DFLOAT _depth) |
Sets clear properties for the back and depth-buffer. | |
void | N3DDEVICE::DrawPrimitive (const N3DCMDSTREAM &_stream) |
Draws a command buffer. | |
void | N3DDEVICE::EndScene () |
Ends a scene. | |
N3DBOOL | N3DDEVICE::GetLightEnable (const unsigned _index) const |
Retrieves the enabled or disabled status of a light. | |
unsigned | N3DDEVICE::GetTexture () const |
Gets the current texture. | |
unsigned | N3DDEVICE::GetTexturePalette () const |
Gets the current texture palette. | |
void | N3DDEVICE::GetViewport (N3DVIEWPORT &_viewport) const |
Gets the viewport parameters. | |
void | N3DDEVICE::Init () |
Initializes the 3D device. | |
void | N3DDEVICE::LightEnable (const unsigned _index, const N3DBOOL _enable) |
Enables or disables a light. | |
void | N3DDEVICE::MultiplyTransform (const N3DTRANSFORMSTATETYPE _state, const N3DMATRIX &_m) |
Multiplies a transformation matrix with the specified matrix. | |
void | N3DDEVICE::Present () |
Present the content of the back buffer. | |
void | N3DDEVICE::Reset () |
Resets the 3D device to its default states. | |
void | N3DDEVICE::SetLight (const unsigned _index, const N3DLIGHT &_light) |
Sets lighting properties. | |
void | N3DDEVICE::SetMaterial (const N3DMATERIAL &_material) |
Sets the material properties. | |
void | N3DDEVICE::SetRenderState (const N3DRENDERSTATETYPE _state, const unsigned _value) |
Sets a render-state parameter. | |
void | N3DDEVICE::SetTexture (const unsigned _vramOffset, const unsigned _width, const unsigned _height, const N3DFORMAT _format) |
Sets the current texture. | |
void | N3DDEVICE::SetTexturePalette (const unsigned _vramOffset, const N3DFORMAT _format) |
Sets the current texture palette. | |
void | N3DDEVICE::SetTextureState (const N3DTEXTURESTATETYPE _type, const unsigned _value) |
Sets a texture state. | |
void | N3DDEVICE::SetTransform (const N3DTRANSFORMSTATETYPE _state, const N3DMATRIX &_m) |
Sets a transformation matrix for the specified state. | |
void | N3DDEVICE::SetViewport (const N3DVIEWPORT &_viewport) |
Sets the viewport parameters. |
void N3DDEVICE::BeginScene | ( | ) | [inherited] |
void N3DDEVICE::Clear | ( | const unsigned | _flags, | |
const N3DCOLOR & | _color, | |||
const N3DFLOAT | _depth | |||
) | [inherited] |
Sets clear properties for the back and depth-buffer.
[in] | _flags | One or more members of the N3DCLEAR enumeration. See remarks. |
[in] | _color | Clear to this color. |
[in] | _depth | Clear depth buffer to this new depth value. Ranges from N3DFLOAT(0) to N3DFLOAT(1). |
Example: Only set the target clear color and keep the old depth value.
void N3DDEVICE::DrawPrimitive | ( | const N3DCMDSTREAM & | _stream | ) | [inherited] |
Draws a command buffer.
[in] | _stream | Reference to a source N3DCMDSTREAM structure. |
void N3DDEVICE::EndScene | ( | ) | [inherited] |
N3DBOOL N3DDEVICE::GetLightEnable | ( | const unsigned | _index | ) | const [inherited] |
Retrieves the enabled or disabled status of a light.
[in] | _index | Zero-based index of light. |
unsigned N3DDEVICE::GetTexture | ( | ) | const [inherited] |
unsigned N3DDEVICE::GetTexturePalette | ( | ) | const [inherited] |
void N3DDEVICE::GetViewport | ( | N3DVIEWPORT & | _viewport | ) | const [inherited] |
Gets the viewport parameters.
[out] | _viewport | Reference to a N3DVIEWPORT structure. |
void N3DDEVICE::Init | ( | ) | [inherited] |
void N3DDEVICE::LightEnable | ( | const unsigned | _index, | |
const N3DBOOL | _enable | |||
) | [inherited] |
Enables or disables a light.
[in] | _index | Index of target light. Up to four lights are supported. Parameter can be set to 0, 1, 2 or 3. |
[in] | _enable | TRUE to enable, FALSE to disable light. |
void N3DDEVICE::MultiplyTransform | ( | const N3DTRANSFORMSTATETYPE | _state, | |
const N3DMATRIX & | _m | |||
) | [inherited] |
Multiplies a transformation matrix with the specified matrix.
[in] | _state | Describes the transformation state. See N3DTRANSFORMSTATETYPE for a list of the supported transformation states. |
[in] | _m | Reference to a N3DMATRIX structure that modifies the current transformation. |
void N3DDEVICE::Reset | ( | ) | [inherited] |
void N3DDEVICE::SetLight | ( | const unsigned | _index, | |
const N3DLIGHT & | _light | |||
) | [inherited] |
Sets lighting properties.
[in] | _index | Index of light. |
[in] | _light | Reference to a source N3DLIGHT structure. |
N3DDEVICE device; N3DLIGHT light; // Setup a violet light light.color.r = N3DFLOAT(1); light.color.g = N3DFLOAT(0); light.color.b = N3DFLOAT(0.5f); // Point along the z-axis light.direction.x = N3DFLOAT(0); light.direction.y = N3DFLOAT(0); light.direction.z = N3DFLOAT(1); // Set the light properties device.SetLight(0, light); // Enable the light device.LightEnable(0, true);
void N3DDEVICE::SetMaterial | ( | const N3DMATERIAL & | _material | ) | [inherited] |
Sets the material properties.
[out] | _material | Reference to a source N3DMATERIAL structure. |
N3DDEVICE device; N3DMATERIAL material; material.ambient.r = N3DFLOAT(0.2f); material.ambient.g = N3DFLOAT(0.2f); material.ambient.b = N3DFLOAT(0.2f); material.diffuse.r = N3DFLOAT(0.4f); material.diffuse.g = N3DFLOAT(0.4f); material.diffuse.b = N3DFLOAT(0.6f); material.specular.r = N3DFLOAT(0.7f); material.specular.g = N3DFLOAT(0.7f); material.specular.b = N3DFLOAT(1.0f); material.emissive.r = N3DFLOAT(0.0f); material.emissive.g = N3DFLOAT(0.0f); material.emissive.b = N3DFLOAT(0.0f); material.alpha = N3DFLOAT(1.0f); device.SetMaterial(material);
void N3DDEVICE::SetRenderState | ( | const N3DRENDERSTATETYPE | _state, | |
const unsigned | _value | |||
) | [inherited] |
Sets a render-state parameter.
[in] | _state | State variable that is being modified. This parameter can be any member of the N3DRENDERSTATETYPE enumerated type. |
[in] | _value | New value for the render state to be set. |
N3DDEVICE device; device.SetRenderState(N3DRS_CULLMODE, N3DCULL_CW);
void N3DDEVICE::SetTexture | ( | const unsigned | _vramOffset, | |
const unsigned | _width, | |||
const unsigned | _height, | |||
const N3DFORMAT | _format | |||
) | [inherited] |
Sets the current texture.
[in] | _vramOffset | Texture Vram offset. The texture Vram offset must be aligned on a 8byte boundary. |
[in] | _width | Texture width in pixels. |
[in] | _height | Texture height in pixels. |
[in] | _format | Texture format. One member of the N3DFORMAT enumeration. |
void N3DDEVICE::SetTexturePalette | ( | const unsigned | _vramOffset, | |
const N3DFORMAT | _format | |||
) | [inherited] |
void N3DDEVICE::SetTextureState | ( | const N3DTEXTURESTATETYPE | _type, | |
const unsigned | _value | |||
) | [inherited] |
Sets a texture state.
[in] | _type | Describes the texture state. See N3DTEXTURESTATETYPE |
[in] | _value | State value. This value depends on the on the _type parameter. |
void N3DDEVICE::SetTransform | ( | const N3DTRANSFORMSTATETYPE | _state, | |
const N3DMATRIX & | _m | |||
) | [inherited] |
Sets a transformation matrix for the specified state.
[in] | _state | Describes the transformation state. See N3DTRANSFORMSTATETYPE for a list of the supported transformation states. |
[in] | _m | Reference to a N3DMATRIX structure that is set as the current transformation. |
void N3DDEVICE::SetViewport | ( | const N3DVIEWPORT & | _viewport | ) | [inherited] |
Sets the viewport parameters.
[in] | _viewport | Reference to a source N3DVIEWPORT structure. |
viewport.x = 0; viewport.y = 0; viewport.width = 256; viewport.height = 192;