home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 March / ENTER.ISO / files / fwp-0.0.6-win32-installer.exe / Material.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-06  |  849 b   |  50 lines

  1. #ifndef __Material_h__
  2. #define __Material_h__
  3.  
  4. #include "Texture.h"
  5. #include "Shader.h"
  6.  
  7. enum SurfaceTypes_e{
  8.     MATERIAL_SURFACE_TYPE_METAL = 0,
  9.     MATERIAL_SURFACE_TYPE_STONE,
  10.     MATERIAL_SURFACE_TYPE_WOOD,
  11.     MATERIAL_SURFACE_TYPE_DIRT,
  12.  
  13.     MATERIAL_NUM_SURFACE_TYPES
  14. };
  15.  
  16. class Material{
  17. public:
  18.     GLfloat color[4];
  19.  
  20.     Texture* texture;
  21.     Texture* lightmap;
  22.     Shader* shader;
  23.  
  24.     bool isTransparent;
  25.     bool hasTexture;
  26.     bool hasLightmap;
  27.     bool hasShader;
  28.     bool isTwoSided;
  29.     unsigned int collisionFlags;
  30.     int surfaceType;
  31.  
  32.     Material();
  33.     Material(File* f);
  34.     ~Material();
  35.     void clearMaterial();
  36.  
  37.     void setup();
  38.     void setdown();
  39.     void setAttribs();
  40.     int addTexture(Texture* tex);
  41.     int addLightmap(Texture* tex);
  42.     int addShader(Shader* sha);
  43.  
  44.     bool readFromFile(File* f);
  45.     void dump();
  46. };
  47.  
  48. #endif    /* __Material_h__ */
  49.  
  50.