Add IMaterialRenderer::getShaderConstantSetCallBack to allow access to user provided shader callbacks.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5668 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2018-12-01 15:55:32 +00:00
parent 386cbffe9a
commit b3e9af5722
4 changed files with 24 additions and 0 deletions

View File

@ -16,6 +16,7 @@ namespace video
class IVideoDriver;
class IMaterialRendererServices;
class IShaderConstantSetCallBack;
//! Interface for material rendering.
/** Can be used to extend the engine with new materials. Refer to
@ -91,6 +92,11 @@ public:
Fixed function pipeline materials should return 0 in most cases, parallax mapped
material will only return 0 when at least pixel shader 1.4 is available on that machine. */
virtual s32 getRenderCapability() const { return 0; }
//! Access the callback provided by the users when creating shader materials
/** \returns Returns either the users provided callback or 0 when no such
callback exists. Non-shader materials will always return 0. */
virtual IShaderConstantSetCallBack* getShaderConstantSetCallBack() const { return 0; }
};

View File

@ -48,6 +48,12 @@ public:
//! Returns if the material is transparent.
virtual bool isTransparent() const _IRR_OVERRIDE_;
//! Access the callback provided by the users when creating shader materials
virtual IShaderConstantSetCallBack* getShaderConstantSetCallBack() const _IRR_OVERRIDE_
{
return CallBack;
}
protected:
//! constructor only for use by derived classes who want to

View File

@ -65,6 +65,12 @@ public:
//! Returns if the material is transparent.
virtual bool isTransparent() const _IRR_OVERRIDE_;
//! Access the callback provided by the users when creating shader materials
virtual IShaderConstantSetCallBack* getShaderConstantSetCallBack() const _IRR_OVERRIDE_
{
return CallBack;
}
// implementations for the render services
virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) _IRR_OVERRIDE_;
virtual s32 getVertexShaderConstantID(const c8* name) _IRR_OVERRIDE_;

View File

@ -44,6 +44,12 @@ public:
//! Returns if the material is transparent.
virtual bool isTransparent() const _IRR_OVERRIDE_;
//! Access the callback provided by the users when creating shader materials
virtual IShaderConstantSetCallBack* getShaderConstantSetCallBack() const _IRR_OVERRIDE_
{
return CallBack;
}
protected:
//! constructor only for use by derived classes who want to