CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

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 
00032 #define CS_DEFMAT_DIFFUSE 0.7f
00033 
00034 #define CS_DEFMAT_AMBIENT 0.0f
00035 
00036 #define CS_DEFMAT_REFLECTION  0.0f
00037 
00038 struct iEffectDefinition;
00039 struct iTextureHandle;
00040 struct csRGBpixel;
00041 struct csRGBcolor;
00042 struct iShader;
00043 
00048 struct csTextureLayer
00049 {
00051   csRef<iTextureHandle> txt_handle;
00053   uint mode;    
00055   float uscale, vscale; 
00057   float ushift, vshift; 
00058 };
00059 
00060 SCF_VERSION (iMaterial, 0, 0, 6);
00061 
00069 struct iMaterial : public iBase
00070 {
00071 #ifdef CS_USE_NEW_RENDERER
00072 
00075   virtual void SetShader (iShader* shader) = 0;
00076 
00080   virtual iShader* GetShader () = 0;
00081 
00082 #endif
00083 
00087   virtual void SetEffect (iEffectDefinition *ed) = 0;
00088 
00092   virtual iEffectDefinition *GetEffect () = 0;
00093 
00097   virtual iTextureHandle *GetTexture () = 0;
00098 
00103   virtual int GetTextureLayerCount () = 0;
00104 
00108   virtual csTextureLayer* GetTextureLayer (int idx) = 0;
00109 
00114   virtual void GetFlatColor (csRGBpixel &oColor, bool useTextureMean=1) = 0;
00118   virtual void SetFlatColor (const csRGBcolor& col) = 0;
00119 
00123   virtual void GetReflection (
00124     float &oDiffuse, float &oAmbient, float &oReflection) = 0;
00128   virtual void SetReflection (float oDiffuse, float oAmbient,
00129     float oReflection) = 0;
00130 };
00131 
00132 SCF_VERSION (iMaterialHandle, 0, 0, 2);
00133 
00138 struct iMaterialHandle : public iBase
00139 {
00140 #ifdef CS_USE_NEW_RENDERER
00141 
00144   virtual iShader* GetShader () = 0;
00145 #endif
00146 
00150   virtual iTextureHandle *GetTexture () = 0;
00151 
00156   virtual void GetFlatColor (csRGBpixel &oColor) = 0;
00157 
00161   virtual void GetReflection (float &oDiffuse, float &oAmbient,
00162         float &oReflection) = 0;
00163 
00170   virtual void Prepare () = 0;
00171 };
00172 
00175 #endif // __CS_IVIDEO_MATERIAL_H__

Generated for Crystal Space by doxygen 1.2.14