Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
dcpp::video::IMaterialRendererServices Class Referenceabstract

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

#include <duckcpp/core/engine/IMaterialRendererServices.hpp>

Public Member Functions

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

Detailed Description

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

Member Function Documentation

◆ getVideoDriver()

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

Get pointer to the IVideoDriver interface.

Returns
Pointer to the IVideoDriver interface

◆ setBasicRenderStates()

virtual void dcpp::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, gouraudshading, 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/4]

DCPP_DEPRECATED bool dcpp::video::IMaterialRendererServices::setPixelShaderConstant ( const dcpp::char_kt name,
const dcpp::float32_kt floats,
int  count 
)
inline
Deprecated:
. This method may be removed by Duckcpp 2.0

◆ setPixelShaderConstant() [2/4]

DCPP_DEPRECATED bool dcpp::video::IMaterialRendererServices::setPixelShaderConstant ( const dcpp::char_kt name,
const dcpp::int32_kt ints,
int  count 
)
inline
Deprecated:
. This method may be removed by Duckcpp 2.0

◆ setPixelShaderConstant() [3/4]

virtual void dcpp::video::IMaterialRendererServices::setPixelShaderConstant ( const dcpp::float32_kt data,
dcpp::int32_kt  startRegister,
dcpp::int32_kt  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/4]

virtual bool dcpp::video::IMaterialRendererServices::setPixelShaderConstant ( dcpp::int32_kt  index,
const dcpp::float32_kt 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.

◆ setVertexShaderConstant() [1/4]

DCPP_DEPRECATED bool dcpp::video::IMaterialRendererServices::setVertexShaderConstant ( const dcpp::char_kt name,
const dcpp::float32_kt floats,
int  count 
)
inline
Deprecated:
. This method may be removed by Duckcpp 2.0

◆ setVertexShaderConstant() [2/4]

DCPP_DEPRECATED bool dcpp::video::IMaterialRendererServices::setVertexShaderConstant ( const dcpp::char_kt name,
const dcpp::int32_kt ints,
int  count 
)
inline
Deprecated:
. This method may be removed by Duckcpp 2.0

◆ setVertexShaderConstant() [3/4]

virtual void dcpp::video::IMaterialRendererServices::setVertexShaderConstant ( const dcpp::float32_kt data,
dcpp::int32_kt  startRegister,
dcpp::int32_kt  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/4]

virtual bool dcpp::video::IMaterialRendererServices::setVertexShaderConstant ( dcpp::int32_kt  index,
const dcpp::float32_kt 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(dcpp::video::IMaterialRendererServices* services, dcpp::int32_kt userData)
{
dcpp::float32_kt time = (dcpp::float32_kt)dcpp::os::Timer::getTime()/100000.0f;
services->setVertexShaderConstant("fTime", &time, 1);
worldViewProj *= driver->getTransform(dcpp::video::ETS_VIEW);
worldViewProj *= driver->getTransform(dcpp::video::ETS_WORLD);
services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
}
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
Definition matrix4.hpp:49
Interface providing some methods for changing advanced, internal states of a IVideoDriver.
Definition IMaterialRendererServices.hpp:21
virtual bool setVertexShaderConstant(dcpp::int32_kt index, const dcpp::float32_kt *floats, int count)=0
Sets a constant for the vertex shader based on a name.
virtual IVideoDriver * getVideoDriver()=0
Get pointer to the IVideoDriver interface.
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.hpp:152
virtual const dcpp::nub::matrix4 & getTransform(E_TRANSFORMATION_STATE state) const =0
Returns the transformation set by setTransform.
@ ETS_PROJECTION
Projection transformation.
Definition IVideoDriver.hpp:60
@ ETS_VIEW
View transformation.
Definition IVideoDriver.hpp:56
@ ETS_WORLD
World transformation.
Definition IVideoDriver.hpp:58
float float32_kt
32 bit floating point variable.
Definition irrTypes.hpp:108
signed int int32_kt
32 bit signed variable.
Definition irrTypes.hpp:72
Parameters
indexIndex of the variable
floatsPointer to array of floats
countAmount of floats in array.
Returns
True if successful.

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

Duckcpp    @cppfx.xyz