Commit 6a7b142b authored by hybrid's avatar hybrid

Add methods to alter the 2d override material.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3029 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6abf9007
......@@ -1322,6 +1322,27 @@ namespace video
\return Reference to the Override Material. */
virtual SOverrideMaterial& getOverrideMaterial() =0;
//! Get the 2d override material for altering its values
/** The 2d override materual allows to alter certain render
states of the 2d methods. Not all members of SMaterial are
honored, especially not MaterialType and Textures. Moreover,
the zbuffer is always ignored, and lighting is always off. All
other flags can be changed, though some might have to effect
in most cases.
Please note that you have to enable/disable this effect with
enableInitMaterial2D(). This effect is costly, as it increases
the number of state changes considerably. Always reset the
values when done.
\return Material reference which should be altered to reflect
the new settings.
*/
virtual SMaterial& getInitMaterial2D() =0;
//! Enable the 2d override material
/** \param enable Flag which tells whether the material shall be
enabled or disabled. */
virtual void enableInitMaterial2D(bool enable=true) =0;
//! Returns the graphics card vendor name.
virtual core::stringc getVendorInfo() =0;
......
......@@ -2164,6 +2164,20 @@ SOverrideMaterial& CNullDriver::getOverrideMaterial()
}
//! Get the 2d override material for altering its values
SMaterial& CNullDriver::getInitMaterial2D()
{
return InitMaterial2D;
}
//! Enable the 2d override material
void CNullDriver::enableInitMaterial2D(bool enable)
{
InitMaterial2DEnabled=enable;
}
core::dimension2du CNullDriver::getMaxTextureSize() const
{
return core::dimension2du(0x10000,0x10000); // maybe large enough
......
......@@ -580,6 +580,12 @@ namespace video
meshbuffer being rendered. */
virtual SOverrideMaterial& getOverrideMaterial();
//! Get the 2d override material for altering its values
virtual SMaterial& getInitMaterial2D();
//! Enable the 2d override material
virtual void enableInitMaterial2D(bool enable=true);
//! Only used by the engine internally.
virtual void setAllowZWriteOnTransparent(bool flag)
{ AllowZWriteOnTransparent=flag; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment