Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages
material.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2000 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_IVIDEO_MATERIAL_H__ 00020 #define __CS_IVIDEO_MATERIAL_H__ 00021 00029 #include "csutil/scf.h" 00030 #include "csutil/strset.h" 00031 00032 #include "ivideo/shader/shader.h" 00033 00034 00036 #define CS_DEFMAT_DIFFUSE 0.7f 00037 00038 #define CS_DEFMAT_AMBIENT 0.0f 00039 00040 #define CS_DEFMAT_REFLECTION 0.0f 00041 00043 #define CS_MATERIAL_VARNAME_DIFFUSE "mat diffuse" 00044 00045 #define CS_MATERIAL_VARNAME_AMBIENT "mat ambient" 00046 00047 #define CS_MATERIAL_VARNAME_REFLECTION "mat reflection" 00048 00049 #define CS_MATERIAL_VARNAME_FLATCOLOR "mat flatcolor" 00050 00051 #define CS_MATERIAL_TEXTURE_DIFFUSE "tex diffuse" 00052 00053 struct iTextureHandle; 00054 struct csRGBpixel; 00055 00056 SCF_VERSION (iMaterial, 0, 1, 0); 00057 00076 struct iMaterial : public iShaderVariableContext 00077 { 00081 virtual void SetShader (csStringID type, iShader* shader) = 0; 00082 00086 virtual iShader* GetShader (csStringID type) = 0; 00087 00091 virtual const csHash<csRef<iShader>, csStringID>& GetShaders() const =0; 00092 00096 virtual iTextureHandle *GetTexture () = 0; 00097 00101 virtual iTextureHandle* GetTexture (csStringID name) = 0; 00102 00108 virtual void GetFlatColor (csRGBpixel &oColor, 00109 bool useTextureMean = true) = 0; 00114 virtual void SetFlatColor (const csRGBcolor& col) = 0; 00115 00120 virtual void GetReflection ( 00121 float &oDiffuse, float &oAmbient, float &oReflection) = 0; 00126 virtual void SetReflection (float oDiffuse, float oAmbient, 00127 float oReflection) = 0; 00128 }; 00129 00132 #endif // __CS_IVIDEO_MATERIAL_H__
Generated for Crystal Space by doxygen 1.4.4