aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CD3D9CgMaterialRenderer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CD3D9CgMaterialRenderer.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CD3D9CgMaterialRenderer.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CD3D9CgMaterialRenderer.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CD3D9CgMaterialRenderer.h
new file mode 100644
index 0000000..7cb4b0f
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/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
23namespace irr
24{
25namespace video
26{
27
28class CD3D9Driver;
29class IShaderConstantSetCallBack;
30
31class CD3D9CgUniformSampler2D : public CCgUniform
32{
33public:
34 CD3D9CgUniformSampler2D(const CGparameter& parameter, bool global);
35
36 void update(const void* data, const SMaterial& material) const;
37};
38
39class CD3D9CgMaterialRenderer : public CCgMaterialRenderer
40{
41public:
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
63protected:
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