2019-12-12 17:32:41 +01:00
|
|
|
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
2021-08-27 17:55:04 +02:00
|
|
|
#ifndef IRR_C_SOFTWARE2_MATERIAL_RENDERER_H_INCLUDED
|
|
|
|
#define IRR_C_SOFTWARE2_MATERIAL_RENDERER_H_INCLUDED
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
#include "SoftwareDriver2_compile_config.h"
|
|
|
|
|
|
|
|
#include "IMaterialRenderer.h"
|
|
|
|
#include "CSoftwareDriver2.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace video
|
|
|
|
{
|
|
|
|
|
|
|
|
//! Base class for all internal Software2 material renderers
|
|
|
|
class CSoftware2MaterialRenderer : public IMaterialRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! Constructor
|
|
|
|
CSoftware2MaterialRenderer(video::CBurningVideoDriver* driver)
|
|
|
|
: Driver(driver)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-02-22 21:48:12 +01:00
|
|
|
virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
|
2021-08-27 14:55:10 +02:00
|
|
|
bool resetAllRenderstates, IMaterialRendererServices* services) IRR_OVERRIDE
|
2020-02-22 21:48:12 +01:00
|
|
|
{
|
|
|
|
if (Driver)
|
2022-05-01 00:57:17 +02:00
|
|
|
Driver->setFallback_Material(material.MaterialType, BVT_Fix);
|
2020-02-22 21:48:12 +01:00
|
|
|
}
|
|
|
|
|
2019-12-12 17:32:41 +01:00
|
|
|
protected:
|
|
|
|
|
|
|
|
video::CBurningVideoDriver* Driver;
|
|
|
|
};
|
|
|
|
|
|
|
|
//! solid material renderer
|
|
|
|
class CSoftware2MaterialRenderer_SOLID : public CSoftware2MaterialRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CSoftware2MaterialRenderer_SOLID ( video::CBurningVideoDriver* driver )
|
|
|
|
:CSoftware2MaterialRenderer ( driver ) {}
|
|
|
|
|
|
|
|
//! Returns if the material is transparent.
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual bool isTransparent() const IRR_OVERRIDE
|
2019-12-12 17:32:41 +01:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//! Transparent material renderer
|
|
|
|
class CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR : public CSoftware2MaterialRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR ( video::CBurningVideoDriver* driver )
|
|
|
|
: CSoftware2MaterialRenderer ( driver ) {}
|
|
|
|
|
|
|
|
|
|
|
|
//! Returns if the material is transparent.
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual bool isTransparent() const IRR_OVERRIDE
|
2019-12-12 17:32:41 +01:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//! unsupported material renderer
|
|
|
|
class CSoftware2MaterialRenderer_UNSUPPORTED : public CSoftware2MaterialRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CSoftware2MaterialRenderer_UNSUPPORTED ( video::CBurningVideoDriver* driver )
|
|
|
|
: CSoftware2MaterialRenderer ( driver ) {}
|
|
|
|
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual s32 getRenderCapability() const IRR_OVERRIDE { return 1; }
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // end namespace video
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|