![]() |
Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
|
Interface making it possible to set constants for gpu programs every frame. More...
#include <duckcpp/core/engine/IShaderConstantSetCallBack.hpp>


Public Member Functions | |
| virtual void | OnSetMaterial (const SMaterial &material) |
| Called to let the callBack know the used material (optional method) | |
| virtual void | OnSetConstants (IMaterialRendererServices *services, dcpp::int32_kt userData)=0 |
| Called by the engine when the vertex and/or pixel shader constants for an material renderer should be set. | |
Public Member Functions inherited from dcpp::IReferenceCounted | |
| IReferenceCounted () | |
| Constructor. | |
| virtual | ~IReferenceCounted () |
| Destructor. | |
| void | grab () const |
| Grabs the object. Increments the reference counter by one. | |
| bool | drop () const |
| Drops the object. Decrements the reference counter by one. | |
| dcpp::int32_kt | getReferenceCount () const |
| Get the reference count. | |
| const dcpp::char_kt * | getDebugName () const |
| Returns the debug name of the object. | |
Additional Inherited Members | |
Protected Member Functions inherited from dcpp::IReferenceCounted | |
| void | setDebugName (const dcpp::char_kt *newName) |
| Sets the debug name of the object. | |
Interface making it possible to set constants for gpu programs every frame.
Implement this interface in an own class and pass a pointer to it to one of the methods in IGPUProgrammingServices when creating a shader. The OnSetConstants method will be called every frame now.
|
pure virtual |
Called by the engine when the vertex and/or pixel shader constants for an material renderer should be set.
Implement the IShaderConstantSetCallBack in an own class and implement your own OnSetConstants method using the given IMaterialRendererServices interface. Pass a pointer to this class to one of the methods in IGPUProgrammingServices when creating a shader. The OnSetConstants method will now be called every time before geometry is being drawn using your shader material. A sample implementation would look like this:
| services | Pointer to an interface providing methods to set the constants for the shader. |
| userData | Userdata int which can be specified when creating the shader. |
|
inlinevirtual |
Called to let the callBack know the used material (optional method)