]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CTRTextureGouraud.h
Fix some more problems with OSX build file.
[irrlicht.git] / source / Irrlicht / CTRTextureGouraud.h
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __C_TRIANGLE_RENDERER_TEXTURE_GOURAUD_H_INCLUDED__\r
6 #define __C_TRIANGLE_RENDERER_TEXTURE_GOURAUD_H_INCLUDED__\r
7 \r
8 #include "IrrCompileConfig.h"\r
9 \r
10 #ifndef _IRR_COMPILE_WITH_SOFTWARE_\r
11 // forward declarations for create methods\r
12 namespace irr\r
13 {\r
14 namespace video\r
15 {\r
16         class ITriangleRenderer;\r
17         class IZBuffer;\r
18 } // end namespace video\r
19 } // end namespace irr\r
20 \r
21 #else\r
22 \r
23 #include "ITriangleRenderer.h"\r
24 #include "IImage.h"\r
25 \r
26 namespace irr\r
27 {\r
28 namespace video\r
29 {\r
30         //! CTRTextureGouraud class\r
31         class CTRTextureGouraud : public ITriangleRenderer\r
32         {\r
33         public:\r
34 \r
35                 //! constructor\r
36                 CTRTextureGouraud(IZBuffer* zbuffer);\r
37 \r
38                 //! destructor\r
39                 virtual ~CTRTextureGouraud();\r
40 \r
41                 //! sets a render target\r
42                 virtual void setRenderTarget(video::IImage* surface, const core::rect<s32>& viewPort) _IRR_OVERRIDE_;\r
43 \r
44                 //! draws an indexed triangle list\r
45                 virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_;\r
46 \r
47                 //! en or disables the backface culling\r
48                 virtual void setBackfaceCulling(bool enabled = true) _IRR_OVERRIDE_;\r
49 \r
50                 //! sets the Texture\r
51                 virtual void setTexture(video::IImage* texture) _IRR_OVERRIDE_;\r
52 \r
53         protected:\r
54 \r
55                 //! vertauscht zwei vertizen\r
56                 inline void swapVertices(const S2DVertex** v1, const S2DVertex** v2)\r
57                 {\r
58                         const S2DVertex* b = *v1;\r
59                         *v1 = *v2;\r
60                         *v2 = b;\r
61                 }\r
62 \r
63                 video::IImage* RenderTarget;\r
64                 core::rect<s32> ViewPortRect;\r
65 \r
66                 IZBuffer* ZBuffer;\r
67 \r
68                 s32 SurfaceWidth;\r
69                 s32 SurfaceHeight;\r
70                 bool BackFaceCullingEnabled;\r
71                 TZBufferType* lockedZBuffer;\r
72                 u16* lockedSurface;\r
73                 u16* lockedTexture;\r
74                 s32 lockedTextureWidth;\r
75                 s32 textureXMask, textureYMask;\r
76                 video::IImage* Texture;\r
77         };\r
78 \r
79 } // end namespace video\r
80 } // end namespace irr\r
81 \r
82 #endif\r
83 \r
84 #endif\r
85 \r