diff options
author | David Walter Seikel | 2013-01-13 17:24:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:24:39 +1000 |
commit | 393b5cd1dc438872af89d334ef6e5fcc59f27d47 (patch) | |
tree | 6a14521219942a08a1b95cb2f5a923a9edd60f63 /libraries/irrlicht-1.8/source/Irrlicht/CD3D9CgMaterialRenderer.h | |
parent | Add a note about rasters suggested start up code. (diff) | |
download | SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.zip SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.gz SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.bz2 SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.xz |
Added Irrlicht 1.8, but without all the Windows binaries.
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CD3D9CgMaterialRenderer.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CD3D9CgMaterialRenderer.h b/libraries/irrlicht-1.8/source/Irrlicht/CD3D9CgMaterialRenderer.h new file mode 100644 index 0000000..7cb4b0f --- /dev/null +++ b/libraries/irrlicht-1.8/source/Irrlicht/CD3D9CgMaterialRenderer.h | |||
@@ -0,0 +1,83 @@ | |||
1 | // Copyright (C) 2012-2012 Patryk Nadrowski | ||
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_DIRECT3D_9_CG_MATERIAL_RENDERER_H_INCLUDED__ | ||
6 | #define __C_DIRECT3D_9_CG_MATERIAL_RENDERER_H_INCLUDED__ | ||
7 | |||
8 | #include "IrrCompileConfig.h" | ||
9 | #if defined(_IRR_COMPILE_WITH_DIRECT3D_9_) && defined(_IRR_COMPILE_WITH_CG_) | ||
10 | |||
11 | #define WIN32_LEAN_AND_MEAN | ||
12 | |||
13 | #include <windows.h> | ||
14 | #include <d3d9.h> | ||
15 | #include <d3dx9.h> | ||
16 | #include "CCgMaterialRenderer.h" | ||
17 | #include "Cg/cgD3D9.h" | ||
18 | |||
19 | #ifdef _MSC_VER | ||
20 | #pragma comment(lib, "cgD3D9.lib") | ||
21 | #endif | ||
22 | |||
23 | namespace irr | ||
24 | { | ||
25 | namespace video | ||
26 | { | ||
27 | |||
28 | class CD3D9Driver; | ||
29 | class IShaderConstantSetCallBack; | ||
30 | |||
31 | class CD3D9CgUniformSampler2D : public CCgUniform | ||
32 | { | ||
33 | public: | ||
34 | CD3D9CgUniformSampler2D(const CGparameter& parameter, bool global); | ||
35 | |||
36 | void update(const void* data, const SMaterial& material) const; | ||
37 | }; | ||
38 | |||
39 | class CD3D9CgMaterialRenderer : public CCgMaterialRenderer | ||
40 | { | ||
41 | public: | ||
42 | CD3D9CgMaterialRenderer(CD3D9Driver* driver, s32& materialType, | ||
43 | const c8* vertexProgram = 0, const c8* vertexEntry = "main", | ||
44 | E_VERTEX_SHADER_TYPE vertexProfile = video::EVST_VS_1_1, | ||
45 | const c8* fragmentProgram = 0, const c8* fragmentEntry = "main", | ||
46 | E_PIXEL_SHADER_TYPE fragmentProfile = video::EPST_PS_1_1, | ||
47 | const c8* geometryProgram = 0, const c8* geometryEntry = "main", | ||
48 | E_GEOMETRY_SHADER_TYPE geometryProfile = video::EGST_GS_4_0, | ||
49 | scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, | ||
50 | scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, | ||
51 | u32 vertices = 0, IShaderConstantSetCallBack* callback = 0, | ||
52 | IMaterialRenderer* baseMaterial = 0, s32 userData = 0); | ||
53 | |||
54 | virtual ~CD3D9CgMaterialRenderer(); | ||
55 | |||
56 | virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services); | ||
57 | virtual bool OnRender(IMaterialRendererServices* services, E_VERTEX_TYPE vtxtype); | ||
58 | virtual void OnUnsetMaterial(); | ||
59 | |||
60 | virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates); | ||
61 | virtual IVideoDriver* getVideoDriver(); | ||
62 | |||
63 | protected: | ||
64 | void init(s32& materialType, | ||
65 | const c8* vertexProgram = 0, const c8* vertexEntry = "main", | ||
66 | E_VERTEX_SHADER_TYPE vertexProfile = video::EVST_VS_1_1, | ||
67 | const c8* fragmentProgram = 0, const c8* fragmentEntry = "main", | ||
68 | E_PIXEL_SHADER_TYPE fragmentProfile = video::EPST_PS_1_1, | ||
69 | const c8* geometryProgram = 0, const c8* geometryEntry = "main", | ||
70 | E_GEOMETRY_SHADER_TYPE geometryProfile = video::EGST_GS_4_0, | ||
71 | scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, | ||
72 | scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, | ||
73 | u32 vertices = 0); | ||
74 | |||
75 | CD3D9Driver* Driver; | ||
76 | }; | ||
77 | |||
78 | } | ||
79 | } | ||
80 | |||
81 | #endif | ||
82 | #endif | ||
83 | |||