CrystalSpace

Public API Reference

ivideo/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 
00072 struct iMaterial : public iShaderVariableContext
00073 {
00077   virtual void SetShader (csStringID type, iShader* shader) = 0;
00078 
00082   virtual iShader* GetShader (csStringID type) = 0;
00083 
00087   virtual const csHash<csRef<iShader>, csStringID>& GetShaders() const =0;
00088 
00092   virtual iTextureHandle *GetTexture () = 0;
00093 
00097   virtual iTextureHandle* GetTexture (csStringID name) = 0;
00098 
00104   virtual void GetFlatColor (csRGBpixel &oColor,
00105     bool useTextureMean = true) = 0;
00110   virtual void SetFlatColor (const csRGBcolor& col) = 0;
00111 
00116   virtual void GetReflection (
00117     float &oDiffuse, float &oAmbient, float &oReflection) = 0;
00122   virtual void SetReflection (float oDiffuse, float oAmbient,
00123     float oReflection) = 0;
00124 };
00125 
00128 #endif // __CS_IVIDEO_MATERIAL_H__

Generated for Crystal Space by doxygen 1.4.6