ScummVM API documentation
Material_EnvMap_Reflect.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * Copyright (C) 2006-2010 - Frictional Games
24 *
25 * This file is part of HPL1 Engine.
26 */
27
28#ifndef HPL_MATERIAL_ENVMAP_REFLECT_H
29#define HPL_MATERIAL_ENVMAP_REFLECT_H
30
31#include "hpl1/engine/graphics/Material.h"
32
33namespace hpl {
34
35//----------------------------------------------------
36
38public:
39 void Setup(iGpuProgram *apProgram, cRenderSettings *apRenderSettings);
40 void SetupMatrix(cMatrixf *apModelMatrix, cRenderSettings *apRenderSettings);
41};
42
43//----------------------------------------------------
44
46public:
47 cMaterial_EnvMap_Reflect(const tString &asName, iLowLevelGraphics *apLowLevelGraphics,
48 cImageManager *apImageManager, cTextureManager *apTextureManager,
49 cRenderer2D *apRenderer, cGpuProgramManager *apProgramManager,
50 eMaterialPicture aPicture, cRenderer3D *apRenderer3D);
51
53
54 tTextureTypeList GetTextureTypes();
55
56 bool UsesType(eMaterialRenderType aType);
57
58 iGpuProgram *getGpuProgram(const eMaterialRenderType aType, const int alPass, iLight3D *apLight);
59 iMaterialProgramSetup *getGpuProgramSetup(const eMaterialRenderType aType, const int alPass, iLight3D *apLight);
60
61 bool VertexProgramUsesLight(eMaterialRenderType aType, int alPass, iLight3D *apLight);
62 bool VertexProgramUsesEye(eMaterialRenderType aType, int alPass, iLight3D *apLight);
63
64 eMaterialAlphaMode GetAlphaMode(eMaterialRenderType aType, int alPass, iLight3D *apLight);
65 eMaterialBlendMode GetBlendMode(eMaterialRenderType aType, int alPass, iLight3D *apLight);
66 eMaterialChannelMode GetChannelMode(eMaterialRenderType aType, int alPass, iLight3D *apLight);
67
68 iTexture *GetTexture(int alUnit, eMaterialRenderType aType, int alPass, iLight3D *apLight);
69 eMaterialBlendMode GetTextureBlend(int alUnit, eMaterialRenderType aType, int alPass, iLight3D *apLight);
70
71 int GetNumOfPasses(eMaterialRenderType aType, iLight3D *apLight) { return 1; }
72
74 // Old and worthless stuff, only used by 2D renderer
75 void Compile() {}
76 bool StartRendering(eMaterialRenderType aType, iCamera *apCam, iLight *pLight) { return false; }
77 void EndRendering(eMaterialRenderType aType) {}
78 tVtxBatchFlag GetBatchFlags(eMaterialRenderType aType) { return 0; }
79 bool NextPass(eMaterialRenderType aType) { return false; }
80 bool HasMultiplePasses(eMaterialRenderType aType) { return false; }
81 eMaterialType GetType(eMaterialRenderType aType) { return eMaterialType_Diffuse; }
82 void EditVertexes(eMaterialRenderType aType, iCamera *apCam, iLight *pLight,
83 tVertexVec *apVtxVec, cVector3f *apTransform, unsigned int alIndexAdd) {}
84
85private:
86 iGpuProgram *_diffuseProgram;
87 iGpuProgram *_diffuseReflectProgram;
88};
89
91public:
92 bool IsCorrect(tString asName) {
93 return cString::ToLowerCase(asName) == "environmentmapreflect";
94 }
95
96 iMaterial *Create(const tString &asName, iLowLevelGraphics *apLowLevelGraphics,
97 cImageManager *apImageManager, cTextureManager *apTextureManager,
98 cRenderer2D *apRenderer, cGpuProgramManager *apProgramManager,
99 eMaterialPicture aPicture, cRenderer3D *apRenderer3D) {
100 return hplNew(cMaterial_EnvMap_Reflect, (asName, apLowLevelGraphics,
101 apImageManager, apTextureManager, apRenderer,
102 apProgramManager, aPicture, apRenderer3D));
103 }
104};
105
106} // namespace hpl
107
108#endif // HPL_MATERIAL_ENVMAP_REFLECT_H
Definition: list.h:44
Definition: str.h:59
Definition: Material_EnvMap_Reflect.h:37
Definition: GpuProgramManager.h:39
Definition: ImageManager.h:48
Definition: Material_EnvMap_Reflect.h:45
bool StartRendering(eMaterialRenderType aType, iCamera *apCam, iLight *pLight)
Definition: Material_EnvMap_Reflect.h:76
bool HasMultiplePasses(eMaterialRenderType aType)
Definition: Material_EnvMap_Reflect.h:80
void EndRendering(eMaterialRenderType aType)
Definition: Material_EnvMap_Reflect.h:77
tVtxBatchFlag GetBatchFlags(eMaterialRenderType aType)
Definition: Material_EnvMap_Reflect.h:78
bool NextPass(eMaterialRenderType aType)
Definition: Material_EnvMap_Reflect.h:79
eMaterialType GetType(eMaterialRenderType aType)
Definition: Material_EnvMap_Reflect.h:81
Definition: Material_EnvMap_Reflect.h:90
Definition: Renderer3D.h:77
Definition: Renderer2D.h:79
Definition: Renderer3D.h:139
static tString ToLowerCase(tString aString)
Definition: TextureManager.h:47
Definition: Camera.h:43
Definition: GPUProgram.h:62
Definition: Light3D.h:117
Definition: Light.h:38
Definition: LowLevelGraphics.h:200
Definition: Material.h:203
Definition: Material.h:181
Definition: Material.h:390
Definition: Texture.h:88