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