2011-01-14 07:36:50 -08:00
|
|
|
// Copyright (C) 2002-2011 Nikolaus Gebhardt
|
2007-05-20 11:03:49 -07:00
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
|
|
|
#ifndef __C_SOFTWARE2_MATERIAL_RENDERER_H_INCLUDED__
|
|
|
|
#define __C_SOFTWARE2_MATERIAL_RENDERER_H_INCLUDED__
|
|
|
|
|
|
|
|
#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
|
2007-11-13 06:36:17 -08:00
|
|
|
CSoftware2MaterialRenderer(video::CBurningVideoDriver* driver)
|
2007-05-20 11:03:49 -07:00
|
|
|
: Driver(driver)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2007-11-13 06:36:17 -08:00
|
|
|
video::CBurningVideoDriver* Driver;
|
2007-05-20 11:03:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
//! solid material renderer
|
|
|
|
class CSoftware2MaterialRenderer_SOLID : public CSoftware2MaterialRenderer
|
|
|
|
{
|
|
|
|
public:
|
2007-11-13 06:36:17 -08:00
|
|
|
CSoftware2MaterialRenderer_SOLID ( video::CBurningVideoDriver* driver )
|
2007-05-20 11:03:49 -07:00
|
|
|
:CSoftware2MaterialRenderer ( driver ) {}
|
|
|
|
|
|
|
|
//! Returns if the material is transparent.
|
2007-09-16 16:41:55 -07:00
|
|
|
virtual bool isTransparent() const
|
2007-05-20 11:03:49 -07:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! Transparent material renderer
|
|
|
|
class CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR : public CSoftware2MaterialRenderer
|
|
|
|
{
|
|
|
|
public:
|
2007-11-13 06:36:17 -08:00
|
|
|
CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR ( video::CBurningVideoDriver* driver )
|
2007-09-16 16:41:55 -07:00
|
|
|
: CSoftware2MaterialRenderer ( driver ) {}
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
//! Returns if the material is transparent.
|
2007-09-16 16:41:55 -07:00
|
|
|
virtual bool isTransparent() const
|
2007-05-20 11:03:49 -07:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//! unsupported material renderer
|
|
|
|
class CSoftware2MaterialRenderer_UNSUPPORTED : public CSoftware2MaterialRenderer
|
|
|
|
{
|
|
|
|
public:
|
2007-11-13 06:36:17 -08:00
|
|
|
CSoftware2MaterialRenderer_UNSUPPORTED ( video::CBurningVideoDriver* driver )
|
2007-09-16 16:41:55 -07:00
|
|
|
: CSoftware2MaterialRenderer ( driver ) {}
|
2007-05-20 11:03:49 -07:00
|
|
|
|
2007-09-16 16:41:55 -07:00
|
|
|
virtual s32 getRenderCapability() const { return 1; }
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2007-11-13 06:36:17 -08:00
|
|
|
//! unsupported material renderer
|
|
|
|
class CBurningShader_REFERENCE : public CSoftware2MaterialRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CBurningShader_REFERENCE ( video::CBurningVideoDriver* driver )
|
|
|
|
: CSoftware2MaterialRenderer ( driver ) {}
|
|
|
|
|
|
|
|
virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
|
|
|
|
bool resetAllRenderstates, IMaterialRendererServices* services)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void OnUnsetMaterial()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool isTransparent() const
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
virtual s32 getRenderCapability() const
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
} // end namespace video
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|