Saxum/game/material.cc

45 lines
1.0 KiB
C++
Raw Normal View History

#include "material.hh"
2014-10-22 21:17:18 +00:00
Material::Material(std::string filePath, float ambientFactor, float diffuseFactor,
float specularFactor, float shininess, bool movingTexture) {
2014-10-22 21:17:18 +00:00
reference = ACGL::OpenGL::Texture2DFileManager::the()->get(ACGL::OpenGL::Texture2DCreator(filePath));
2014-12-04 17:58:16 +00:00
reference->generateMipmaps();
reference->setMinFilter(GL_NEAREST_MIPMAP_LINEAR);
reference->setMagFilter(GL_LINEAR);
this->ambientFactor = ambientFactor;
this->diffuseFactor = diffuseFactor;
this->specularFactor = specularFactor;
this->shininess = shininess;
this->movingTexture = movingTexture;
2014-10-22 21:17:18 +00:00
}
Material::Material() {
}
Material::~Material() {
2014-10-22 21:17:18 +00:00
}
ACGL::OpenGL::SharedTexture2D Material::getReference() {
2014-10-22 21:17:18 +00:00
return reference;
}
float Material::getAmbientFactor(){
return ambientFactor;
}
float Material::getDiffuseFactor(){
return diffuseFactor;
}
float Material::getSpecularFactor() {
return specularFactor;
}
float Material::getShininess() {
return shininess;
}
bool Material::isMoving(){
return movingTexture;
}