blob: 80936139a3e56eb24fa06177ceaba229d707d81a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
// 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
#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
CSoftware2MaterialRenderer(video::CBurningVideoDriver* driver)
: Driver(driver)
{
}
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.
virtual bool isTransparent() const
{
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.
virtual bool isTransparent() const
{
return true;
}
};
//! unsupported material renderer
class CSoftware2MaterialRenderer_UNSUPPORTED : public CSoftware2MaterialRenderer
{
public:
CSoftware2MaterialRenderer_UNSUPPORTED ( video::CBurningVideoDriver* driver )
: CSoftware2MaterialRenderer ( driver ) {}
virtual s32 getRenderCapability() const { return 1; }
};
//! 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;
}
};
} // end namespace video
} // end namespace irr
#endif
|