absence_thelab

diff src/3deng/material.h @ 0:1cffe3409164

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 23 Oct 2014 01:46:07 +0300
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/3deng/material.h	Thu Oct 23 01:46:07 2014 +0300
     1.3 @@ -0,0 +1,49 @@
     1.4 +#ifndef _MATERIAL_H_
     1.5 +#define _MATERIAL_H_
     1.6 +
     1.7 +#include <string>
     1.8 +#include <vector>
     1.9 +#include "d3d8.h"
    1.10 +#include "3dengtypes.h"
    1.11 +#include "color.h"
    1.12 +
    1.13 +enum TextureType { 
    1.14 +	TextureMap = 0,
    1.15 +	DetailMap,
    1.16 +	OpacityMap, 
    1.17 +	LightMap, 
    1.18 +	BumpMap, 
    1.19 +	EnvironmentMap,
    1.20 +	SpecularMap
    1.21 +};
    1.22 +
    1.23 +const int NumberOfTextureTypes = 7;
    1.24 +
    1.25 +class Material : public D3DMATERIAL8 {
    1.26 +public:
    1.27 +	std::string name;
    1.28 +	Texture *Maps[NumberOfTextureTypes];
    1.29 +	float EnvBlend, BumpIntensity;
    1.30 +	float Alpha;
    1.31 +	bool SpecularEnable;
    1.32 +
    1.33 +	Material();
    1.34 +	Material(float r, float g, float b, float a=1.0f);
    1.35 +
    1.36 +	void SetAmbient(float r, float g, float b);
    1.37 +	void SetAmbient(const Color &col);
    1.38 +	void SetDiffuse(float r, float g, float b);
    1.39 +	void SetDiffuse(const Color &col);
    1.40 +	void SetSpecular(float r, float g, float b);
    1.41 +	void SetSpecular(const Color &col);
    1.42 +	void SetEmissive(float r, float g, float b);
    1.43 +	void SetEmissive(const Color &col);
    1.44 +	void SetSpecularPower(float pow);
    1.45 +	void SetAlpha(float alpha);
    1.46 +	void SetEnvBlend(float value);	
    1.47 +
    1.48 +	void SetTexture(Texture *texture, TextureType type);
    1.49 +};
    1.50 +
    1.51 +
    1.52 +#endif	// _MATERIAL_H_
    1.53 \ No newline at end of file