arsa  2.7
Public Member Functions | List of all members
irr::video::IMaterialRendererServices Class Referenceabstract

Interface providing some methods for changing advanced, internal states of a IVideoDriver. More...

#include <IMaterialRendererServices.h>

Public Member Functions

virtual ~IMaterialRendererServices ()
 Destructor. More...
 
virtual void setBasicRenderStates (const SMaterial &material, const SMaterial &lastMaterial, bool resetAllRenderstates)=0
 Can be called by an IMaterialRenderer to make its work easier. More...
 
virtual s32 getVertexShaderConstantID (const c8 *name)=0
 Return an index constant for the vertex shader based on a name. More...
 
virtual bool setVertexShaderConstant (s32 index, const f32 *floats, int count)=0
 Sets a constant for the vertex shader based on a name. More...
 
virtual bool setVertexShaderConstant (s32 index, const s32 *ints, int count)=0
 Int interface for the above. More...
 
virtual void setVertexShaderConstant (const f32 *data, s32 startRegister, s32 constantAmount=1)=0
 Sets a vertex shader constant. More...
 
virtual s32 getPixelShaderConstantID (const c8 *name)=0
 Return an index constant for the pixel shader based on a name. More...
 
virtual bool setPixelShaderConstant (s32 index, const f32 *floats, int count)=0
 Sets a constant for the pixel shader based on a name. More...
 
virtual bool setPixelShaderConstant (s32 index, const s32 *ints, int count)=0
 Int interface for the above. More...
 
virtual void setPixelShaderConstant (const f32 *data, s32 startRegister, s32 constantAmount=1)=0
 Sets a pixel shader constant. More...
 
_IRR_DEPRECATED_ bool setVertexShaderConstant (const c8 *name, const f32 *floats, int count)
 
_IRR_DEPRECATED_ bool setVertexShaderConstant (const c8 *name, const s32 *ints, int count)
 
_IRR_DEPRECATED_ bool setPixelShaderConstant (const c8 *name, const f32 *floats, int count)
 
_IRR_DEPRECATED_ bool setPixelShaderConstant (const c8 *name, const s32 *ints, int count)
 
virtual IVideoDrivergetVideoDriver ()=0
 Get pointer to the IVideoDriver interface. More...
 

Detailed Description

Interface providing some methods for changing advanced, internal states of a IVideoDriver.

Definition at line 20 of file IMaterialRendererServices.h.

Constructor & Destructor Documentation

◆ ~IMaterialRendererServices()

virtual irr::video::IMaterialRendererServices::~IMaterialRendererServices ( )
inlinevirtual

Destructor.

Definition at line 25 of file IMaterialRendererServices.h.

25 {}

Member Function Documentation

◆ getPixelShaderConstantID()

virtual s32 irr::video::IMaterialRendererServices::getPixelShaderConstantID ( const c8 name)
pure virtual

Return an index constant for the pixel shader based on a name.

◆ getVertexShaderConstantID()

virtual s32 irr::video::IMaterialRendererServices::getVertexShaderConstantID ( const c8 name)
pure virtual

Return an index constant for the vertex shader based on a name.

◆ getVideoDriver()

virtual IVideoDriver* irr::video::IMaterialRendererServices::getVideoDriver ( )
pure virtual

Get pointer to the IVideoDriver interface.

Returns
Pointer to the IVideoDriver interface

◆ setBasicRenderStates()

virtual void irr::video::IMaterialRendererServices::setBasicRenderStates ( const SMaterial material,
const SMaterial lastMaterial,
bool  resetAllRenderstates 
)
pure virtual

Can be called by an IMaterialRenderer to make its work easier.

Sets all basic renderstates if needed. Basic render states are diffuse, ambient, specular, and emissive color, specular power, bilinear and trilinear filtering, wireframe mode, grouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and fog enabling.

Parameters
materialThe new material to be used.
lastMaterialThe material used until now.
resetAllRenderstatesSet to true if all renderstates should be set, regardless of their current state.

◆ setPixelShaderConstant() [1/5]

virtual bool irr::video::IMaterialRendererServices::setPixelShaderConstant ( s32  index,
const f32 floats,
int  count 
)
pure virtual

Sets a constant for the pixel shader based on a name.

This can be used if you used a high level shader language like GLSL or HLSL to create a shader. See setVertexShaderConstant() for an example on how to use this.

Parameters
indexIndex of the variable
floatsPointer to array of floats
countAmount of floats in array.
Returns
True if successful.

◆ setPixelShaderConstant() [2/5]

virtual bool irr::video::IMaterialRendererServices::setPixelShaderConstant ( s32  index,
const s32 ints,
int  count 
)
pure virtual

Int interface for the above.

◆ setPixelShaderConstant() [3/5]

virtual void irr::video::IMaterialRendererServices::setPixelShaderConstant ( const f32 data,
s32  startRegister,
s32  constantAmount = 1 
)
pure virtual

Sets a pixel shader constant.

Can be used if you created a shader using pixel/vertex shader assembler or ARB_fragment_program or ARB_vertex_program.

Parameters
dataData to be set in the constants
startRegisterFirst register to be set.
constantAmountAmount of registers to be set. One register consists of 4 floats.

◆ setPixelShaderConstant() [4/5]

_IRR_DEPRECATED_ bool irr::video::IMaterialRendererServices::setPixelShaderConstant ( const c8 name,
const f32 floats,
int  count 
)
inline
Deprecated:
. This method may be removed by Irrlicht 2.0

Definition at line 119 of file IMaterialRendererServices.h.

120  {
122  }
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
GLuint const GLchar * name
virtual s32 getPixelShaderConstantID(const c8 *name)=0
Return an index constant for the pixel shader based on a name.
virtual bool setPixelShaderConstant(s32 index, const f32 *floats, int count)=0
Sets a constant for the pixel shader based on a name.

◆ setPixelShaderConstant() [5/5]

_IRR_DEPRECATED_ bool irr::video::IMaterialRendererServices::setPixelShaderConstant ( const c8 name,
const s32 ints,
int  count 
)
inline
Deprecated:
. This method may be removed by Irrlicht 2.0

Definition at line 125 of file IMaterialRendererServices.h.

126  {
128  }
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
GLuint const GLchar * name
virtual s32 getPixelShaderConstantID(const c8 *name)=0
Return an index constant for the pixel shader based on a name.
virtual bool setPixelShaderConstant(s32 index, const f32 *floats, int count)=0
Sets a constant for the pixel shader based on a name.

◆ setVertexShaderConstant() [1/5]

virtual bool irr::video::IMaterialRendererServices::setVertexShaderConstant ( s32  index,
const f32 floats,
int  count 
)
pure virtual

Sets a constant for the vertex shader based on a name.

This can be used if you used a high level shader language like GLSL or HLSL to create a shader. Example: If you created a shader which has variables named 'mWorldViewProj' (containing the WorldViewProjection matrix) and another one named 'fTime' containing one float, you can set them in your IShaderConstantSetCallBack derived class like this:

virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
{
video::IVideoDriver* driver = services->getVideoDriver();
f32 time = (f32)os::Timer::getTime()/100000.0f;
services->setVertexShaderConstant("fTime", &time, 1);
core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION));
worldViewProj *= driver->getTransform(video::ETS_VIEW);
worldViewProj *= driver->getTransform(video::ETS_WORLD);
services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
}
Parameters
indexIndex of the variable
floatsPointer to array of floats
countAmount of floats in array.
Returns
True if successful.

◆ setVertexShaderConstant() [2/5]

virtual bool irr::video::IMaterialRendererServices::setVertexShaderConstant ( s32  index,
const s32 ints,
int  count 
)
pure virtual

Int interface for the above.

◆ setVertexShaderConstant() [3/5]

virtual void irr::video::IMaterialRendererServices::setVertexShaderConstant ( const f32 data,
s32  startRegister,
s32  constantAmount = 1 
)
pure virtual

Sets a vertex shader constant.

Can be used if you created a shader using pixel/vertex shader assembler or ARB_fragment_program or ARB_vertex_program.

Parameters
dataData to be set in the constants
startRegisterFirst register to be set
constantAmountAmount of registers to be set. One register consists of 4 floats.

◆ setVertexShaderConstant() [4/5]

_IRR_DEPRECATED_ bool irr::video::IMaterialRendererServices::setVertexShaderConstant ( const c8 name,
const f32 floats,
int  count 
)
inline
Deprecated:
. This method may be removed by Irrlicht 2.0

Definition at line 107 of file IMaterialRendererServices.h.

108  {
110  }
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
GLuint const GLchar * name
virtual s32 getVertexShaderConstantID(const c8 *name)=0
Return an index constant for the vertex shader based on a name.
virtual bool setVertexShaderConstant(s32 index, const f32 *floats, int count)=0
Sets a constant for the vertex shader based on a name.

◆ setVertexShaderConstant() [5/5]

_IRR_DEPRECATED_ bool irr::video::IMaterialRendererServices::setVertexShaderConstant ( const c8 name,
const s32 ints,
int  count 
)
inline
Deprecated:
. This method may be removed by Irrlicht 2.0

Definition at line 113 of file IMaterialRendererServices.h.

114  {
116  }
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
GLuint const GLchar * name
virtual s32 getVertexShaderConstantID(const c8 *name)=0
Return an index constant for the vertex shader based on a name.
virtual bool setVertexShaderConstant(s32 index, const f32 *floats, int count)=0
Sets a constant for the vertex shader based on a name.

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