diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CD3D9HLSLMaterialRenderer.h | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CD3D9HLSLMaterialRenderer.h b/libraries/irrlicht-1.8/source/Irrlicht/CD3D9HLSLMaterialRenderer.h index 2e051b7..1f14cc7 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CD3D9HLSLMaterialRenderer.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CD3D9HLSLMaterialRenderer.h | |||
@@ -1,85 +1,85 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __C_D3D9_HLSL_MATERIAL_RENDERER_H_INCLUDED__ | 5 | #ifndef __C_D3D9_HLSL_MATERIAL_RENDERER_H_INCLUDED__ |
6 | #define __C_D3D9_HLSL_MATERIAL_RENDERER_H_INCLUDED__ | 6 | #define __C_D3D9_HLSL_MATERIAL_RENDERER_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IrrCompileConfig.h" | 8 | #include "IrrCompileConfig.h" |
9 | #ifdef _IRR_WINDOWS_ | 9 | #ifdef _IRR_WINDOWS_ |
10 | 10 | ||
11 | #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ | 11 | #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ |
12 | 12 | ||
13 | #include "CD3D9ShaderMaterialRenderer.h" | 13 | #include "CD3D9ShaderMaterialRenderer.h" |
14 | #include "IGPUProgrammingServices.h" | 14 | #include "IGPUProgrammingServices.h" |
15 | 15 | ||
16 | namespace irr | 16 | namespace irr |
17 | { | 17 | { |
18 | namespace video | 18 | namespace video |
19 | { | 19 | { |
20 | 20 | ||
21 | class IVideoDriver; | 21 | class IVideoDriver; |
22 | class IShaderConstantSetCallBack; | 22 | class IShaderConstantSetCallBack; |
23 | class IMaterialRenderer; | 23 | class IMaterialRenderer; |
24 | 24 | ||
25 | //! Class for using vertex and pixel shaders via HLSL with D3D9 | 25 | //! Class for using vertex and pixel shaders via HLSL with D3D9 |
26 | class CD3D9HLSLMaterialRenderer : public CD3D9ShaderMaterialRenderer | 26 | class CD3D9HLSLMaterialRenderer : public CD3D9ShaderMaterialRenderer |
27 | { | 27 | { |
28 | public: | 28 | public: |
29 | 29 | ||
30 | //! Public constructor | 30 | //! Public constructor |
31 | CD3D9HLSLMaterialRenderer(IDirect3DDevice9* d3ddev, video::IVideoDriver* driver, | 31 | CD3D9HLSLMaterialRenderer(IDirect3DDevice9* d3ddev, video::IVideoDriver* driver, |
32 | s32& outMaterialTypeNr, | 32 | s32& outMaterialTypeNr, |
33 | const c8* vertexShaderProgram, | 33 | const c8* vertexShaderProgram, |
34 | const c8* vertexShaderEntryPointName, | 34 | const c8* vertexShaderEntryPointName, |
35 | E_VERTEX_SHADER_TYPE vsCompileTarget, | 35 | E_VERTEX_SHADER_TYPE vsCompileTarget, |
36 | const c8* pixelShaderProgram, | 36 | const c8* pixelShaderProgram, |
37 | const c8* pixelShaderEntryPointName, | 37 | const c8* pixelShaderEntryPointName, |
38 | E_PIXEL_SHADER_TYPE psCompileTarget, | 38 | E_PIXEL_SHADER_TYPE psCompileTarget, |
39 | IShaderConstantSetCallBack* callback, | 39 | IShaderConstantSetCallBack* callback, |
40 | IMaterialRenderer* baseMaterial, | 40 | IMaterialRenderer* baseMaterial, |
41 | s32 userData); | 41 | s32 userData); |
42 | 42 | ||
43 | //! Destructor | 43 | //! Destructor |
44 | ~CD3D9HLSLMaterialRenderer(); | 44 | ~CD3D9HLSLMaterialRenderer(); |
45 | 45 | ||
46 | //! sets a variable in the shader. | 46 | //! sets a variable in the shader. |
47 | //! \param vertexShader: True if this should be set in the vertex shader, false if | 47 | //! \param vertexShader: True if this should be set in the vertex shader, false if |
48 | //! in the pixel shader. | 48 | //! in the pixel shader. |
49 | //! \param name: Name of the variable | 49 | //! \param name: Name of the variable |
50 | //! \param floats: Pointer to array of floats | 50 | //! \param floats: Pointer to array of floats |
51 | //! \param count: Amount of floats in array. | 51 | //! \param count: Amount of floats in array. |
52 | virtual bool setVariable(bool vertexShader, const c8* name, const f32* floats, int count); | 52 | virtual bool setVariable(bool vertexShader, const c8* name, const f32* floats, int count); |
53 | 53 | ||
54 | //! Bool interface for the above. | 54 | //! Bool interface for the above. |
55 | virtual bool setVariable(bool vertexShader, const c8* name, const bool* bools, int count); | 55 | virtual bool setVariable(bool vertexShader, const c8* name, const bool* bools, int count); |
56 | 56 | ||
57 | //! Int interface for the above. | 57 | //! Int interface for the above. |
58 | virtual bool setVariable(bool vertexShader, const c8* name, const s32* ints, int count); | 58 | virtual bool setVariable(bool vertexShader, const c8* name, const s32* ints, int count); |
59 | 59 | ||
60 | bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype); | 60 | bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype); |
61 | 61 | ||
62 | protected: | 62 | protected: |
63 | 63 | ||
64 | bool createHLSLVertexShader(const char* vertexShaderProgram, | 64 | bool createHLSLVertexShader(const char* vertexShaderProgram, |
65 | const char* shaderEntryPointName, | 65 | const char* shaderEntryPointName, |
66 | const char* shaderTargetName); | 66 | const char* shaderTargetName); |
67 | 67 | ||
68 | bool createHLSLPixelShader(const char* pixelShaderProgram, | 68 | bool createHLSLPixelShader(const char* pixelShaderProgram, |
69 | const char* shaderEntryPointName, | 69 | const char* shaderEntryPointName, |
70 | const char* shaderTargetName); | 70 | const char* shaderTargetName); |
71 | 71 | ||
72 | void printHLSLVariables(LPD3DXCONSTANTTABLE table); | 72 | void printHLSLVariables(LPD3DXCONSTANTTABLE table); |
73 | 73 | ||
74 | LPD3DXCONSTANTTABLE VSConstantsTable; | 74 | LPD3DXCONSTANTTABLE VSConstantsTable; |
75 | LPD3DXCONSTANTTABLE PSConstantsTable; | 75 | LPD3DXCONSTANTTABLE PSConstantsTable; |
76 | }; | 76 | }; |
77 | 77 | ||
78 | 78 | ||
79 | } // end namespace video | 79 | } // end namespace video |
80 | } // end namespace irr | 80 | } // end namespace irr |
81 | 81 | ||
82 | #endif | 82 | #endif |
83 | #endif | 83 | #endif |
84 | #endif | 84 | #endif |
85 | 85 | ||