PixelLightAPI  .
Classes | Public Member Functions | Protected Member Functions
PLRenderer::FixedFunctions Class Reference

Abstract fixed functions renderer interface. More...

#include <FixedFunctions.h>

List of all members.

Classes

struct  Capabilities
 Holds all hardware capabilities. More...
class  Fog
 Fog modes. More...
struct  Light
 Light data. More...
class  LightType
 Light types. More...
class  MaterialState
 Material states. More...
class  RenderState
 Fixed functions render states. More...
class  Shade
 Shade modes. More...
class  TexCoordGen
 Texture coordinate generation modes. More...
class  TextureEnvironment
 Texture environment modes. More...
class  TextureStage
 Texture stage states. More...
class  Transform
 Transform states. More...

Public Member Functions

virtual const CapabilitiesGetCapabilities () const =0
 Returns the renderer fixed functions capabilities.
virtual void Reset ()=0
 Resets all fixed functions render states, texture units etc. to default.
virtual PLCore::uint32 GetDefaultRenderState (RenderState::Enum nState) const =0
 Returns a default render state.
virtual void ResetRenderStates ()=0
 Resets all render states to default.
virtual int GetRenderState (RenderState::Enum nState) const =0
 Retrieves a render-state value.
virtual bool SetRenderState (RenderState::Enum nState, PLCore::uint32 nValue)=0
 Sets a single render-state parameter.
virtual PLGraphics::Color4 GetColor () const =0
 Gets the current color.
virtual void SetColor (const PLGraphics::Color4 &cColor=PLGraphics::Color4::White)=0
 Sets the current color.
virtual void ResetTransformStates ()=0
 Resets all transform states to default (identity matrix)
virtual const PLMath::Matrix4x4GetTransformState (Transform::Enum nState, bool bOriginal=true) const =0
 Retrieves a transform-state value.
virtual bool SetTransformState (Transform::Enum nState, const PLMath::Matrix3x4 &mTrans)=0
 Sets a single transform-state parameter.
virtual bool SetTransformState (Transform::Enum nState, const PLMath::Matrix4x4 &mTrans)=0
virtual PLCore::uint32 GetDefaultTextureStageState (TextureStage::Enum nState) const =0
 Returns a default texture stage state.
virtual void ResetTextureStageStates ()=0
 Resets all texture stage states to default.
virtual int GetTextureStageState (PLCore::uint32 nStage, TextureStage::Enum nState) const =0
 Retrieves a texture stage state value.
virtual bool SetTextureStageState (PLCore::uint32 nStage, TextureStage::Enum nState, PLCore::uint32 nValue)=0
 Sets a single texture stage state parameter.
virtual PLCore::uint32 GetDefaultMaterialState (MaterialState::Enum nState) const =0
 Returns a default material state.
virtual void ResetMaterialStates ()=0
 Resets all material states to default.
virtual int GetMaterialState (MaterialState::Enum nState) const =0
 Retrieves a material-state value.
virtual bool SetMaterialState (MaterialState::Enum nState, PLCore::uint32 nValue)=0
 Sets a single material-state parameter.
virtual void GetDefaultLightSettings (Light &sLight) const =0
 Gets the default light settings.
virtual void ResetLights ()=0
 Resets the lights.
virtual bool IsLightEnabled (PLCore::uint32 nLightID) const =0
 Returns whether a light is enabled or not.
virtual bool SetLightEnabled (PLCore::uint32 nLightID, bool bEnabled)=0
 Sets whether a light is enabled or not.
virtual bool GetLight (PLCore::uint32 nLightID, Light &sLight) const =0
 Returns light settings.
virtual bool SetLight (PLCore::uint32 nLightID, const Light &sLight)=0
 Sets light settings.
virtual bool IsClipPlaneEnabled (PLCore::uint8 nIndex) const =0
 Returns whether a clip plane is enabled/disabled.
virtual bool SetClipPlaneEnabled (char nIndex=-1, bool bEnable=false)=0
 Enables/disables a clip plane.
virtual bool GetClipPlane (PLCore::uint8 nIndex, float &fA, float &fB, float &fC, float &fD) const =0
 Returns a clip plane.
virtual bool SetClipPlane (char nIndex=-1, float fA=0.0f, float fB=0.0f, float fC=0.0f, float fD=0.0f)=0
 Sets a clip plane.
virtual VertexBufferGetVertexBuffer (PLCore::uint32 nStreamNumber=0, PLCore::uint32 *pnOffset=nullptr) const =0
 Gets the current vertex buffer.
virtual bool SetVertexBuffer (VertexBuffer *pVertexBuffer=nullptr, PLCore::uint32 nOffset=0, PLCore::uint32 nStreamNumber=0)=0
 Sets the current vertex buffer.

Protected Member Functions

PLRENDERER_API FixedFunctions ()
 Constructor.
virtual PLRENDERER_API ~FixedFunctions ()
 Destructor.

Detailed Description

Abstract fixed functions renderer interface.

Note:
  • A legacy renderer interface for previously build in features in old graphics APIs and GPUs

Constructor & Destructor Documentation

PLRENDERER_API PLRenderer::FixedFunctions::FixedFunctions ( ) [protected]

Constructor.

virtual PLRENDERER_API PLRenderer::FixedFunctions::~FixedFunctions ( ) [protected, virtual]

Destructor.


Member Function Documentation

virtual const Capabilities& PLRenderer::FixedFunctions::GetCapabilities ( ) const [pure virtual]

Returns the renderer fixed functions capabilities.

Returns:
The renderer fixed functions capabilities
virtual void PLRenderer::FixedFunctions::Reset ( ) [pure virtual]

Resets all fixed functions render states, texture units etc. to default.

Note:
virtual PLCore::uint32 PLRenderer::FixedFunctions::GetDefaultRenderState ( RenderState::Enum  nState) const [pure virtual]

Returns a default render state.

Parameters:
[in]nStateRender state to return the default value from
Returns:
The default state
virtual void PLRenderer::FixedFunctions::ResetRenderStates ( ) [pure virtual]

Resets all render states to default.

See also:
virtual int PLRenderer::FixedFunctions::GetRenderState ( RenderState::Enum  nState) const [pure virtual]

Retrieves a render-state value.

Parameters:
[in]nStateState variable that is being queried. This parameter can be any member of the render state enumerated type.
Returns:
The value of the queried render state variable, < 0 on error
See also:
virtual bool PLRenderer::FixedFunctions::SetRenderState ( RenderState::Enum  nState,
PLCore::uint32  nValue 
) [pure virtual]

Sets a single render-state parameter.

Parameters:
[in]nStateState variable that is being modified. This parameter can be any member of the render state enumerated type.
[in]nValueNew value for the render state to be set. The meaning of this parameter is dependent on the value specified for nState. For example, if nState is FogMode, the second parameter must be one member of the Shade enumerated type. (e.g. Fog::Exp)
Returns:
'true' if all went fine, else 'false'
See also:
virtual PLGraphics::Color4 PLRenderer::FixedFunctions::GetColor ( ) const [pure virtual]

Gets the current color.

Returns:
Current RGBA color
virtual void PLRenderer::FixedFunctions::SetColor ( const PLGraphics::Color4 cColor = PLGraphics::Color4::White) [pure virtual]

Sets the current color.

Parameters:
[in]cColorRGBA color
virtual void PLRenderer::FixedFunctions::ResetTransformStates ( ) [pure virtual]

Resets all transform states to default (identity matrix)

virtual const PLMath::Matrix4x4& PLRenderer::FixedFunctions::GetTransformState ( Transform::Enum  nState,
bool  bOriginal = true 
) const [pure virtual]

Retrieves a transform-state value.

Parameters:
[in]nStateState variable that is being queried. This parameter can be any member of the transform enumerated type.
[in]bOriginalReturn the original set state? The returned transform state may differ from the given original state. OpenGL backend example: If a rectangle texture buffer is used the used transform matrix is scaled because in this case OpenGL requires not normalized texture coordinates. If you give this matrix to a shader program, don't use the original matrix! This has only an influence on the texture matrices, view etc. matrices are always original.
Returns:
The requested matrix, on error the projection matrix is returned
Note:
  • A transform state is a 4x4 matrix. Matrices are assumed to be stored in column major order like OpenGL does.
virtual bool PLRenderer::FixedFunctions::SetTransformState ( Transform::Enum  nState,
const PLMath::Matrix3x4 mTrans 
) [pure virtual]

Sets a single transform-state parameter.

Parameters:
[in]nStateState variable that is being modified. This parameter can be any member of the transform enumerated type.
[in]mTransNew value for the transform state to be set
Returns:
'true' if all went fine, else 'false'
See also:
virtual bool PLRenderer::FixedFunctions::SetTransformState ( Transform::Enum  nState,
const PLMath::Matrix4x4 mTrans 
) [pure virtual]
virtual PLCore::uint32 PLRenderer::FixedFunctions::GetDefaultTextureStageState ( TextureStage::Enum  nState) const [pure virtual]

Returns a default texture stage state.

Parameters:
[in]nStateTexture stage state to return the default value from
Returns:
The default state
virtual void PLRenderer::FixedFunctions::ResetTextureStageStates ( ) [pure virtual]

Resets all texture stage states to default.

See also:
virtual int PLRenderer::FixedFunctions::GetTextureStageState ( PLCore::uint32  nStage,
TextureStage::Enum  nState 
) const [pure virtual]

Retrieves a texture stage state value.

Parameters:
[in]nStageTexture stage to get the value from
[in]nStateState variable that is being queried. This parameter can be any member of the texture stage enumerated type.
Returns:
The value of the queried texture stage state variable, < 0 on error
See also:
virtual bool PLRenderer::FixedFunctions::SetTextureStageState ( PLCore::uint32  nStage,
TextureStage::Enum  nState,
PLCore::uint32  nValue 
) [pure virtual]

Sets a single texture stage state parameter.

Parameters:
[in]nStageTexture stage to set the value
[in]nStateState variable that is being modified. This parameter can be any member of the texture stage enumerated type.
[in]nValueNew value for the texture stage state to be set. The meaning of this parameter is dependent on the value specified for nState. For example, if nState is TextureStage::ColorTexEnv, the second parameter must be one member of the texture environment enumerated type. (e.g. TextureEnvironment::Modulate)
Returns:
'true' if all went fine, else 'false'
See also:
virtual PLCore::uint32 PLRenderer::FixedFunctions::GetDefaultMaterialState ( MaterialState::Enum  nState) const [pure virtual]

Returns a default material state.

Parameters:
[in]nStateMaterial state to return the default value from
Returns:
The default state
The default state
virtual void PLRenderer::FixedFunctions::ResetMaterialStates ( ) [pure virtual]

Resets all material states to default.

See also:
virtual int PLRenderer::FixedFunctions::GetMaterialState ( MaterialState::Enum  nState) const [pure virtual]

Retrieves a material-state value.

Parameters:
[in]nStateState variable that is being queried. This parameter can be any member of the material enumerated type.
Returns:
The value of the queried material state variable, < 0 on error
See also:
virtual bool PLRenderer::FixedFunctions::SetMaterialState ( MaterialState::Enum  nState,
PLCore::uint32  nValue 
) [pure virtual]

Sets a single material-state parameter.

Parameters:
[in]nStateState variable that is being modified. This parameter can be any member of the material enumerated type.
[in]nValueNew value for the material state to be set
Returns:
'true' if all went fine, else 'false'
See also:
virtual void PLRenderer::FixedFunctions::GetDefaultLightSettings ( Light sLight) const [pure virtual]

Gets the default light settings.

Parameters:
[out]sLightLight structure which will receive the default settings
virtual void PLRenderer::FixedFunctions::ResetLights ( ) [pure virtual]

Resets the lights.

See also:
virtual bool PLRenderer::FixedFunctions::IsLightEnabled ( PLCore::uint32  nLightID) const [pure virtual]

Returns whether a light is enabled or not.

Parameters:
[in]nLightIDID of the light
Returns:
'true' if the light is enabled, else 'false'
See also:
virtual bool PLRenderer::FixedFunctions::SetLightEnabled ( PLCore::uint32  nLightID,
bool  bEnabled 
) [pure virtual]

Sets whether a light is enabled or not.

Parameters:
[in]nLightIDID of the light
[in]bEnabledIs this light enabled?
Returns:
'true' if all went fine, else 'false'
See also:
virtual bool PLRenderer::FixedFunctions::GetLight ( PLCore::uint32  nLightID,
Light sLight 
) const [pure virtual]

Returns light settings.

Parameters:
[in]nLightIDID of the light
[out]sLightWill receive the light settings
Returns:
'true' if all went fine, else 'false'
See also:
virtual bool PLRenderer::FixedFunctions::SetLight ( PLCore::uint32  nLightID,
const Light sLight 
) [pure virtual]

Sets light settings.

Parameters:
[in]nLightIDID of the light
[in]sLightThe light settings
Returns:
'true' if all went fine, else 'false'
See also:
virtual bool PLRenderer::FixedFunctions::IsClipPlaneEnabled ( PLCore::uint8  nIndex) const [pure virtual]

Returns whether a clip plane is enabled/disabled.

Parameters:
[in]nIndexIndex (0 - Capabilities::nMaxClipPlanes-1) of the clip plane which should be checked
Returns:
'true' if the requested clip plane is enabled, else 'false'
Note:
  • A clip plane specifies a plane against which all geometry is clipped
  • By default, all clipping planes are defined as (0,0,0,0) in eye coordinates and are disabled
  • The coefficients which the clip plane methods take have the form of the general plane equation
  • Clip planes will only work in fix pass and often they are not well supported by hardware. So try to avoid using clip planes whenever you can!
virtual bool PLRenderer::FixedFunctions::SetClipPlaneEnabled ( char  nIndex = -1,
bool  bEnable = false 
) [pure virtual]

Enables/disables a clip plane.

Parameters:
[in]nIndexIndex (0 - Capabilities::nMaxClipPlanes-1) of the clip plane which should be enabled/disabled, < 0 = Set all clip planes to this value
[in]bEnableShould the defined clip clip plane be enabled?
Returns:
'true' if all went fine, else 'false' (maybe invalid plane index)
See also:
virtual bool PLRenderer::FixedFunctions::GetClipPlane ( PLCore::uint8  nIndex,
float &  fA,
float &  fB,
float &  fC,
float &  fD 
) const [pure virtual]

Returns a clip plane.

Parameters:
[in]nIndexIndex (0 - Capabilities::nMaxClipPlanes-1) of the clip plane which should be returned
[out]fAWill receive the A coefficient of the requested clip plane
[out]fBWill receive the B coefficient of the requested clip plane
[out]fCWill receive the C coefficient of the requested clip plane
[out]fDWill receive the D coefficient of the requested clip plane
Returns:
'true' if all went fine, else 'false' (maybe invalid plane index)
See also:
virtual bool PLRenderer::FixedFunctions::SetClipPlane ( char  nIndex = -1,
float  fA = 0.0f,
float  fB = 0.0f,
float  fC = 0.0f,
float  fD = 0.0f 
) [pure virtual]

Sets a clip plane.

Parameters:
[in]nIndexIndex (0 - Capabilities::nMaxClipPlanes-1) of the clip plane which should be returned < 0 = Set all clip planes to this value
[in]fAThe new A coefficient of the given clip plane
[in]fBThe new B coefficient of the given clip plane
[in]fCThe new C coefficient of the given clip plane
[in]fDThe new D coefficient of the given clip plane
Returns:
'true' if all went fine, else 'false' (maybe invalid plane index)
See also:
virtual VertexBuffer* PLRenderer::FixedFunctions::GetVertexBuffer ( PLCore::uint32  nStreamNumber = 0,
PLCore::uint32 *  pnOffset = nullptr 
) const [pure virtual]

Gets the current vertex buffer.

Parameters:
[in]nStreamNumberSpecifies the data stream number (0 - Capabilities::nMaxVertexBufferStreams()-1)
[out]pnOffsetIf not a null pointer, this variable will receive the vertex offset in bytes
Returns:
The current vertex buffer, a null pointer if there's no one
Note:
  • By assigning different vertex buffers to different stream numbers its for instance possible to get the vertex positions from vertex buffer 0, the vertex normals from vertex buffer 1 and so on.
  • Try to avoid conflicts in which different vertex buffers want to provide for instance the vertex positions!
  • For better performance, try to avoid using more than one vertex buffer at the same time whenever possible.
virtual bool PLRenderer::FixedFunctions::SetVertexBuffer ( VertexBuffer pVertexBuffer = nullptr,
PLCore::uint32  nOffset = 0,
PLCore::uint32  nStreamNumber = 0 
) [pure virtual]

Sets the current vertex buffer.

Parameters:
[in]pVertexBufferThe vertex buffer which should be set, a null pointer if no vertex buffer should be set
[in]nOffsetVertex offset (vertex index, NOT in bytes!)
[in]nStreamNumberSpecifies the data stream number (0 - Capabilities::nMaxVertexBufferStreams()-1)
Returns:
'true' if all went fine, else 'false' (maybe this is already the current vertex buffer)
Note:
  • If nStreamNumber is 0 and pVertexBuffer is a null pointer no vertex buffer at any stream number is set
  • If the first stream (the base stream) is set all other stream settings are cleared
  • See GetVertexBuffer()

The documentation for this class was generated from the following file:


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:38
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported