|
material.h00001 /* 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 __IVIDEO_MATERIAL_H__ 00020 #define __IVIDEO_MATERIAL_H__ 00021 00022 #include "csutil/scf.h" 00023 00025 #define CS_DEFMAT_DIFFUSE 0.7f 00026 00027 #define CS_DEFMAT_AMBIENT 0.0f 00028 00029 #define CS_DEFMAT_REFLECTION 0.0f 00030 00031 struct iTextureHandle; 00032 struct csRGBpixel; 00033 struct csRGBcolor; 00034 00039 struct csTextureLayer 00040 { 00041 iTextureHandle* txt_handle; 00042 uint mode; // Mode: one of CS_FX_ADD ... 00043 float uscale, vscale; // Txt mapping scale relative to parent texture 00044 float ushift, vshift; // Txt mapping shift relative to parent texture 00045 }; 00046 00047 SCF_VERSION (iMaterial, 0, 0, 4); 00048 00056 struct iMaterial : public iBase 00057 { 00061 virtual iTextureHandle *GetTexture () = 0; 00062 00067 virtual int GetTextureLayerCount () = 0; 00068 00072 virtual csTextureLayer* GetTextureLayer (int idx) = 0; 00073 00078 virtual void GetFlatColor (csRGBpixel &oColor) = 0; 00082 virtual void SetFlatColor (const csRGBcolor& col) = 0; 00083 00087 virtual void GetReflection ( 00088 float &oDiffuse, float &oAmbient, float &oReflection) = 0; 00092 virtual void SetReflection (float oDiffuse, float oAmbient, 00093 float oReflection) = 0; 00094 }; 00095 00096 SCF_VERSION (iMaterialHandle, 0, 0, 2); 00097 00102 struct iMaterialHandle : public iBase 00103 { 00107 virtual iTextureHandle *GetTexture () = 0; 00108 00113 virtual void GetFlatColor (csRGBpixel &oColor) = 0; 00114 00118 virtual void GetReflection (float &oDiffuse, float &oAmbient, float &oReflection) = 0; 00119 00126 virtual void Prepare () = 0; 00127 }; 00128 00129 #endif // __IVIDEO_MATERIAL_H__ Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000 |