2014-11-08 00:17:23 +00:00
|
|
|
#ifndef MATERIAL_HH_INCLUDED
|
|
|
|
#define MATERIAL_HH_INCLUDED
|
2014-10-20 17:09:34 +00:00
|
|
|
|
|
|
|
#include <string>
|
2015-03-18 15:26:20 +00:00
|
|
|
#include <set>
|
2014-10-22 21:17:18 +00:00
|
|
|
#include <ACGL/OpenGL/Creator/Texture2DCreator.hh>
|
|
|
|
#include <ACGL/OpenGL/Data/TextureLoadStore.hh>
|
|
|
|
#include <ACGL/OpenGL/Managers.hh>
|
2014-10-20 17:09:34 +00:00
|
|
|
|
2015-03-18 15:26:20 +00:00
|
|
|
using namespace ACGL::OpenGL;
|
|
|
|
|
2014-11-08 00:17:23 +00:00
|
|
|
class Material{
|
2014-10-20 17:09:34 +00:00
|
|
|
public:
|
2014-11-08 00:44:24 +00:00
|
|
|
Material(std::string filePath, float ambientFactor,
|
2015-03-06 14:24:02 +00:00
|
|
|
float diffuseFactor, float specularFactor, float shininess, bool movingTexture = false);
|
2015-02-13 12:46:41 +00:00
|
|
|
Material();
|
2015-03-18 15:26:20 +00:00
|
|
|
SharedTexture2D getReference();
|
2014-11-08 00:17:23 +00:00
|
|
|
~Material();
|
2014-11-08 00:44:24 +00:00
|
|
|
float getAmbientFactor();
|
|
|
|
float getDiffuseFactor();
|
|
|
|
float getSpecularFactor();
|
|
|
|
float getShininess();
|
2015-03-06 14:24:02 +00:00
|
|
|
bool isMoving();
|
2015-03-18 15:26:20 +00:00
|
|
|
static std::vector<SharedTexture2D>* getAllTextures();
|
2015-03-21 14:05:22 +00:00
|
|
|
static std::vector<Material*>* getAllMaterials();
|
2015-03-19 17:26:51 +00:00
|
|
|
int getTextureUnit();
|
2015-03-06 14:24:02 +00:00
|
|
|
|
2014-10-20 17:09:34 +00:00
|
|
|
private:
|
2015-03-19 17:26:51 +00:00
|
|
|
int textureUnit;
|
2014-10-22 21:17:18 +00:00
|
|
|
ACGL::OpenGL::SharedTexture2D reference;
|
2014-11-08 00:44:24 +00:00
|
|
|
float ambientFactor;
|
|
|
|
float diffuseFactor;
|
|
|
|
float specularFactor;
|
|
|
|
float shininess;
|
2015-03-06 14:24:02 +00:00
|
|
|
bool movingTexture;
|
2015-03-18 15:26:20 +00:00
|
|
|
static std::set<SharedTexture2D> allTexturesSet;
|
|
|
|
static std::vector<SharedTexture2D> allTexturesVector;
|
2014-10-20 17:09:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|