Irrlicht 3D Engine
IMaterialRenderer.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_MATERIAL_RENDERER_H_INCLUDED__
6 #define __I_MATERIAL_RENDERER_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "SMaterial.h"
10 #include "S3DVertex.h"
11 
12 namespace irr
13 {
14 namespace video
15 {
16 
17 class IVideoDriver;
18 class IMaterialRendererServices;
19 
21 
24 class IMaterialRenderer : public virtual IReferenceCounted
25 {
26 public:
27 
29 
50  virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
51  bool resetAllRenderstates, IMaterialRendererServices* services) {}
52 
54 
71  virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { return true; }
72 
74 
76  virtual void OnUnsetMaterial() {}
77 
79 
81  virtual bool isTransparent() const { return false; }
82 
84 
93  virtual s32 getRenderCapability() const { return 0; }
94 };
95 
96 
97 } // end namespace video
98 } // end namespace irr
99 
100 #endif
101 
irr::video::IMaterialRenderer
Interface for material rendering.
Definition: IMaterialRenderer.h:24
irr::video::IMaterialRenderer::isTransparent
virtual bool isTransparent() const
Returns if the material is transparent.
Definition: IMaterialRenderer.h:81
irr::video::IMaterialRendererServices
Interface providing some methods for changing advanced, internal states of a IVideoDriver.
Definition: IMaterialRendererServices.h:20
IReferenceCounted.h
irr::video::E_VERTEX_TYPE
E_VERTEX_TYPE
Enumeration for all vertex types there are.
Definition: S3DVertex.h:18
irr::video::IMaterialRenderer::OnRender
virtual bool OnRender(IMaterialRendererServices *service, E_VERTEX_TYPE vtxtype)
Called every time before a new bunch of geometry is being drawn using this material with for example ...
Definition: IMaterialRenderer.h:71
irr::s32
signed int s32
32 bit signed variable.
Definition: irrTypes.h:66
irr::video::IMaterialRenderer::OnUnsetMaterial
virtual void OnUnsetMaterial()
Called by the IVideoDriver to unset this material.
Definition: IMaterialRenderer.h:76
irr::IReferenceCounted
Base class of most objects of the Irrlicht Engine.
Definition: IReferenceCounted.h:41
S3DVertex.h
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
irr::video::IMaterialRenderer::getRenderCapability
virtual s32 getRenderCapability() const
Returns the render capability of the material.
Definition: IMaterialRenderer.h:93
irr::video::SMaterial
Struct for holding parameters for a material renderer.
Definition: SMaterial.h:226
irr::video::IMaterialRenderer::OnSetMaterial
virtual void OnSetMaterial(const SMaterial &material, const SMaterial &lastMaterial, bool resetAllRenderstates, IMaterialRendererServices *services)
Called by the IVideoDriver implementation the let the renderer set its needed render states.
Definition: IMaterialRenderer.h:50
SMaterial.h