Added texture, assets, tools and texture loading.

This commit is contained in:
2022-10-20 21:50:52 -07:00
parent 80d6cba854
commit 043873cc2d
38 changed files with 1626 additions and 15 deletions

View File

@ -89,6 +89,10 @@ void Shader::setTexture(
shaderparameter_t param,
std::shared_ptr<Texture> texture
) {
if(texture == nullptr || !texture->isReady()) {
this->bindTexture(param, nullptr);
return;
}
this->bindTexture(param, texture);
}

View File

@ -30,7 +30,7 @@ namespace Dawn {
}
void setDefaultParameters(Material &material) override {
material.colorValues[this->paramColor] = COLOR_MAGENTA;
material.colorValues[this->paramColor] = COLOR_WHITE;
}
void setGlobalParameters(glm::mat4 proj, glm::mat4 view) override {
@ -97,7 +97,6 @@ namespace Dawn {
this->paramHasTexture = this->getParameterByName("u_HasTexture");
this->setBoolean(this->paramHasTexture, false);
this->setColor(this->paramColor, COLOR_WHITE);
}
};
}