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
|
// 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 __I_TRIANGLE_RENDERER_H_INCLUDED__
#define __I_TRIANGLE_RENDERER_H_INCLUDED__
#include "IReferenceCounted.h"
#include "S2DVertex.h"
#include "rect.h"
#include "IZBuffer.h"
namespace irr
{
namespace video
{
class IImage;
enum ETriangleRenderer
{
ETR_FLAT = 0,
ETR_FLAT_WIRE,
ETR_GOURAUD,
ETR_GOURAUD_WIRE,
ETR_TEXTURE_FLAT,
ETR_TEXTURE_FLAT_WIRE,
ETR_TEXTURE_GOURAUD,
ETR_TEXTURE_GOURAUD_WIRE,
ETR_TEXTURE_GOURAUD_NOZ,
ETR_TEXTURE_GOURAUD_ADD,
ETR_COUNT
};
class ITriangleRenderer : public virtual IReferenceCounted
{
public:
//! sets a render target
virtual void setRenderTarget(video::IImage* surface, const core::rect<s32>& viewPort) = 0;
//! en or disables the backface culling
virtual void setBackfaceCulling(bool enabled = true) = 0;
//! sets the Texture
virtual void setTexture(video::IImage* texture) = 0;
//! draws an indexed triangle list
virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) = 0;
};
ITriangleRenderer* createTriangleRendererTextureGouraud(IZBuffer* zbuffer);
ITriangleRenderer* createTriangleRendererTextureGouraudWire(IZBuffer* zbuffer);
ITriangleRenderer* createTriangleRendererGouraud(IZBuffer* zbuffer);
ITriangleRenderer* createTriangleRendererGouraudWire(IZBuffer* zbuffer);
ITriangleRenderer* createTriangleRendererTextureFlat(IZBuffer* zbuffer);
ITriangleRenderer* createTriangleRendererTextureFlatWire(IZBuffer* zbuffer);
ITriangleRenderer* createTriangleRendererFlat(IZBuffer* zbuffer);
ITriangleRenderer* createTriangleRendererFlatWire(IZBuffer* zbuffer);
ITriangleRenderer* createTriangleRendererTextureGouraudNoZ();
ITriangleRenderer* createTriangleRendererTextureGouraudAdd(IZBuffer* zbuffer);
} // end namespace video
} // end namespace irr
#endif
|