Commit e71b30cb authored by Bastian Krayer's avatar Bastian Krayer

Updated CVK - put sources into appropriate namespace block

parent 4766b5ec
......@@ -19,11 +19,11 @@ class ShaderMinimal : public CVK::ShaderSet {
/**
* Constructor for ShaderMinimal with given parameters. Collects uniform
* locations for all used variables from Shader Program.
* @param shader_mask Describes which shader files are used
* @param shaderMask Describes which shader files are used
* @param shaderPaths Array of paths to shader files
*/
ShaderMinimal(GLuint shader_mask, const char** shaderPaths);
ShaderMinimal(GLuint shader_mask,
ShaderMinimal(GLuint shaderMask, const char** shaderPaths);
ShaderMinimal(GLuint shaderMask,
const std::vector<std::string>& shaderNames);
/**
* @brief Standard Setter for model matrix in shader
......
......@@ -22,11 +22,11 @@ class ShaderPhong : public CVK::ShaderMinimal {
/**
* Constructor for ShaderPhong with given parameters. Collects uniform
* locations for all used variables from Shader Program.
* @param shader_mask Describes which shader files are used
* @param shaderMask Describes which shader files are used
* @param shaderPaths Array of paths to shader files
*/
ShaderPhong(GLuint shader_mask, const char** shaderPaths);
ShaderPhong(GLuint shader_mask,
ShaderPhong(GLuint shaderMask, const char** shaderPaths);
ShaderPhong(GLuint shaderMask,
const std::vector<std::string>& shaderNames);
/**
......
......@@ -18,10 +18,10 @@ class ShaderPostProcessing : public CVK::ShaderSet {
/**
* Constructor for ShaderPostProcessing with given parameters. Collects
* uniform locations for all used variables from Shader Program.
* @param shader_mask Describes which shader files are used
* @param shaderMask Describes which shader files are used
* @param shaderPaths Array of paths to shader files
*/
ShaderPostProcessing(GLuint shader_mask, const char** shaderPaths);
ShaderPostProcessing(GLuint shaderMask, const char** shaderPaths);
ShaderPostProcessing(GLuint shader_mask,
const std::vector<std::string>& shaderPaths);
......
......@@ -98,10 +98,10 @@ class ShaderSet {
*/
void loadShaderSource(GLint shaderID, const char* fileName) const;
GLuint m_shader_mask; //!< Which shaders does the program contain
GLuint m_shader_mask{}; //!< Which shaders does the program contain
protected:
GLuint m_ProgramID; //!< The OpenGL shader program id
GLuint m_ProgramID{}; //!< The OpenGL shader program id
std::vector<GLuint> m_textures; //!< Convenience list of OpenGL texture
//!< objects to set in shader program
};
......
......@@ -163,11 +163,11 @@ class State {
glm::vec3 m_lightAmbient = glm::vec3(0.0f, 0.0f, 0.0f);
glm::vec3 m_BackgroundColor = glm::vec3(1.0f, 1.0f, 1.0f);
int m_fogMode;
glm::vec3 m_fogCol;
float m_fogStart;
float m_fogEnd;
float m_fogDens;
int m_fogMode{};
glm::vec3 m_fogCol{};
float m_fogStart{};
float m_fogEnd{};
float m_fogDens{};
std::string m_shaderPath = "./";
std::string m_resourcesPath = "./";
......
#include <CVK_2/CVK_Camera.h>
CVK::Camera::Camera(GLFWwindow* window) : m_window(window) {}
namespace CVK {
CVK::Camera::~Camera() = default;
Camera::Camera(GLFWwindow* window) : m_window(window) {}
glm::mat4* CVK::Camera::getView() { return &m_viewmatrix; }
Camera::~Camera() = default;
void CVK::Camera::getView(glm::vec3* x, glm::vec3* y, glm::vec3* z,
glm::vec3* pos) const {
glm::mat4* Camera::getView() { return &m_viewmatrix; }
void Camera::getView(glm::vec3* x, glm::vec3* y, glm::vec3* z,
glm::vec3* pos) const {
*x = glm::vec3(glm::row(m_viewmatrix, 0));
*y = glm::vec3(glm::row(m_viewmatrix, 1));
*z = glm::vec3(glm::row(m_viewmatrix, 2));
......@@ -16,24 +18,26 @@ void CVK::Camera::getView(glm::vec3* x, glm::vec3* y, glm::vec3* z,
*pos = -mat_inv * *pos;
}
void CVK::Camera::setView(glm::mat4* view) { m_viewmatrix = *view; }
void Camera::setView(glm::mat4* view) { m_viewmatrix = *view; }
void CVK::Camera::setWidthHeight(int width, int height) {
void Camera::setWidthHeight(int width, int height) {
m_width = width;
m_height = height;
}
void CVK::Camera::getWidthHeight(int* width, int* height) const {
void Camera::getWidthHeight(int* width, int* height) const {
*width = m_width;
*height = m_height;
}
void CVK::Camera::lookAt(glm::vec3 position, glm::vec3 center, glm::vec3 up) {
void Camera::lookAt(glm::vec3 position, glm::vec3 center, glm::vec3 up) {
m_viewmatrix = glm::lookAt(position, center, up);
}
void CVK::Camera::setProjection(CVK::Projection* projection) {
void Camera::setProjection(Projection* projection) {
m_projection = projection;
}
CVK::Projection* CVK::Camera::getProjection() const { return m_projection; }
Projection* Camera::getProjection() const { return m_projection; }
} // namespace CVK
\ No newline at end of file
#include <CVK_2/CVK_Cone.h>
CVK::Cone::Cone() {
namespace CVK {
Cone::Cone() {
m_baseradius = 1.0f;
m_apexradius = 1.0f;
m_basepoint = glm::vec3(0);
......@@ -11,8 +13,7 @@ CVK::Cone::Cone() {
create();
}
CVK::Cone::Cone(float baseradius, float apexradius, float height,
int resolution) {
Cone::Cone(float baseradius, float apexradius, float height, int resolution) {
m_baseradius = baseradius;
m_apexradius = apexradius;
m_basepoint = glm::vec3(0);
......@@ -23,8 +24,8 @@ CVK::Cone::Cone(float baseradius, float apexradius, float height,
create();
}
CVK::Cone::Cone(glm::vec3 basepoint, glm::vec3 apexpoint, float baseradius,
float apexradius, int resolution) {
Cone::Cone(glm::vec3 basepoint, glm::vec3 apexpoint, float baseradius,
float apexradius, int resolution) {
m_baseradius = baseradius;
m_apexradius = apexradius;
m_basepoint = basepoint;
......@@ -35,25 +36,25 @@ CVK::Cone::Cone(glm::vec3 basepoint, glm::vec3 apexpoint, float baseradius,
create();
}
CVK::Cone::~Cone() = default;
Cone::~Cone() = default;
glm::vec3* CVK::Cone::getBasepoint() { return &m_basepoint; }
glm::vec3* Cone::getBasepoint() { return &m_basepoint; }
glm::vec3* CVK::Cone::getApexpoint() { return &m_apexpoint; }
glm::vec3* Cone::getApexpoint() { return &m_apexpoint; }
glm::vec3* CVK::Cone::get_u() { return &m_u; }
glm::vec3* Cone::get_u() { return &m_u; }
glm::vec3* CVK::Cone::get_v() { return &m_v; }
glm::vec3* Cone::get_v() { return &m_v; }
glm::vec3* CVK::Cone::get_w() { return &m_w; }
glm::vec3* Cone::get_w() { return &m_w; }
float CVK::Cone::getBaseradius() const { return m_baseradius; }
float Cone::getBaseradius() const { return m_baseradius; }
float CVK::Cone::getSlope() const { return m_slope; }
float Cone::getSlope() const { return m_slope; }
float CVK::Cone::getApexradius() const { return m_apexradius; }
float Cone::getApexradius() const { return m_apexradius; }
void CVK::Cone::create() {
void Cone::create() {
// iniatialize the variable we are going to use
float u, v;
float radius, phi;
......@@ -118,3 +119,5 @@ void CVK::Cone::create() {
createBuffers();
}
} // namespace CVK
\ No newline at end of file
#include <CVK_2/CVK_Cube.h>
CVK::Cube::Cube() {
namespace CVK {
Cube::Cube() {
create(1.0f);
m_geotype = CVK_CUBE;
}
CVK::Cube::Cube(float size) {
Cube::Cube(float size) {
create(size);
m_geotype = CVK_CUBE;
}
CVK::Cube::~Cube() {}
Cube::~Cube() {}
// A -1.0f, 1.0f, 1.0f
// B -1.0f, -1.0f, 1.0f
......@@ -21,7 +23,7 @@ CVK::Cube::~Cube() {}
// G -1.0f, -1.0f, -1.0f
// H -1.0f, 1.0f, -1.0f
void CVK::Cube::create(float size) {
void Cube::create(float size) {
// A, B, C, D, Front
// H, G, B, A, Left
......@@ -80,7 +82,7 @@ void CVK::Cube::create(float size) {
createBuffers();
}
void CVK::Cube::setSize(float size) {
void Cube::setSize(float size) {
m_vertices.clear();
......@@ -104,3 +106,5 @@ void CVK::Cube::setSize(float size) {
glBufferData(GL_ARRAY_BUFFER, m_points * sizeof(glm::vec4), &m_vertices[0],
GL_STATIC_DRAW);
}
} // namespace CVK
\ No newline at end of file
......@@ -4,23 +4,23 @@
#include <stb/stb_image.h>
#include <string>
CVK::CubeMapTexture::CubeMapTexture(const std::vector<std::string>& fileNames) {
namespace CVK {
CubeMapTexture::CubeMapTexture(const std::vector<std::string>& fileNames) {
m_textureID = INVALID_GL_VALUE;
createCubeMapTexture();
load(fileNames);
}
CVK::CubeMapTexture::CubeMapTexture(GLuint texture) {
setCubeMapTexture(texture);
}
CubeMapTexture::CubeMapTexture(GLuint texture) { setCubeMapTexture(texture); }
CVK::CubeMapTexture::~CubeMapTexture() {
CubeMapTexture::~CubeMapTexture() {
if (m_textureID != INVALID_GL_VALUE)
glDeleteTextures(1, &m_textureID);
}
void CVK::CubeMapTexture::createCubeMapTexture() {
void CubeMapTexture::createCubeMapTexture() {
glGenTextures(1, &m_textureID);
glBindTexture(GL_TEXTURE_CUBE_MAP, m_textureID);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
......@@ -30,7 +30,7 @@ void CVK::CubeMapTexture::createCubeMapTexture() {
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
}
bool CVK::CubeMapTexture::load(const std::vector<std::string>& fileNames) {
bool CubeMapTexture::load(const std::vector<std::string>& fileNames) {
assert(fileNames.size() == 6);
GLint types[6] = {
GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
......@@ -74,15 +74,15 @@ bool CVK::CubeMapTexture::load(const std::vector<std::string>& fileNames) {
return true;
}
void CVK::CubeMapTexture::bind() const {
void CubeMapTexture::bind() const {
if (m_textureID != INVALID_GL_VALUE)
glBindTexture(GL_TEXTURE_CUBE_MAP, m_textureID);
}
void CVK::CubeMapTexture::setCubeMapTexture(GLuint texture) {
void CubeMapTexture::setCubeMapTexture(GLuint texture) {
m_textureID = texture;
}
unsigned int CVK::CubeMapTexture::getCubeMapTexture() const {
return m_textureID;
}
unsigned int CubeMapTexture::getCubeMapTexture() const { return m_textureID; }
} // namespace CVK
\ No newline at end of file
......@@ -2,15 +2,17 @@
#include <iostream>
CVK::FBO::FBO(int width, int height, int numColorTextures, bool depthTexture,
bool stencilTexture) {
namespace CVK {
FBO::FBO(int width, int height, int numColorTextures, bool depthTexture,
bool stencilTexture) {
create(width, height, numColorTextures, depthTexture, stencilTexture);
}
CVK::FBO::~FBO() { reset(); }
FBO::~FBO() { reset(); }
void CVK::FBO::create(int width, int height, int numColorTextures,
bool depthTexture, bool stencilTexture) {
void FBO::create(int width, int height, int numColorTextures, bool depthTexture,
bool stencilTexture) {
reset();
m_width = width;
......@@ -68,7 +70,7 @@ void CVK::FBO::create(int width, int height, int numColorTextures,
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
void CVK::FBO::reset() {
void FBO::reset() {
// delete all textures
for (unsigned int i = 0; i < m_colorTextures.size(); i++) {
glDeleteTextures(1, &m_colorTextures[i]);
......@@ -87,7 +89,7 @@ void CVK::FBO::reset() {
m_frameBufferHandle = INVALID_GL_VALUE;
}
void CVK::FBO::resize(int width, int height) {
void FBO::resize(int width, int height) {
int numColorTextures = m_colorTextures.size();
bool depthTexture = false;
if (m_depthTexture != INVALID_GL_VALUE)
......@@ -100,28 +102,28 @@ void CVK::FBO::resize(int width, int height) {
create(width, height, numColorTextures, depthTexture, stencilTexture);
}
void CVK::FBO::bind() const {
void FBO::bind() const {
glBindFramebuffer(GL_FRAMEBUFFER, m_frameBufferHandle);
glViewport(0, 0, m_width, m_height);
}
void CVK::FBO::unbind() const { glBindFramebuffer(GL_FRAMEBUFFER, 0); }
void FBO::unbind() const { glBindFramebuffer(GL_FRAMEBUFFER, 0); }
GLuint CVK::FBO::getColorTexture(unsigned int index) {
GLuint FBO::getColorTexture(unsigned int index) {
// does color buffer with given index exist ?
if (index < m_colorTextures.size())
return m_colorTextures[index];
return 0;
}
GLuint CVK::FBO::getDepthTexture() const {
GLuint FBO::getDepthTexture() const {
// does depth buffer exist ?
if (m_depthTexture == INVALID_GL_VALUE)
return 0;
return m_depthTexture;
}
GLuint CVK::FBO::createTexture() const {
GLuint FBO::createTexture() const {
// generate fresh texture in OpenGL
GLuint textureID;
glGenTextures(1, &textureID);
......@@ -133,3 +135,5 @@ GLuint CVK::FBO::createTexture() const {
return textureID;
}
} // namespace CVK
#include <CVK_2/CVK_Geometry.h>
CVK::Geometry::Geometry() = default;
namespace CVK {
CVK::Geometry::~Geometry() {
Geometry::Geometry() = default;
Geometry::~Geometry() {
glDeleteBuffers(1, &m_vertexbuffer);
glDeleteBuffers(1, &m_normalbuffer);
glDeleteBuffers(1, &m_uvbuffer);
......@@ -12,9 +14,9 @@ CVK::Geometry::~Geometry() {
glDeleteVertexArrays(1, &m_vao);
}
int CVK::Geometry::getGeoType() const { return m_geotype; }
int Geometry::getGeoType() const { return m_geotype; }
void CVK::Geometry::createBuffers() {
void Geometry::createBuffers() {
m_points = m_vertices.size();
m_indices = m_index.size();
......@@ -102,13 +104,13 @@ void CVK::Geometry::createBuffers() {
glDisableVertexAttribArray(TANGENTS);
}
void CVK::Geometry::render() {
void Geometry::render() {
glBindVertexArray(m_vao);
glDrawElements(GL_TRIANGLES, m_indices, GL_UNSIGNED_INT, 0);
}
void CVK::Geometry::computeTangents() {
void Geometry::computeTangents() {
m_tangents.resize(m_vertices.size());
for (int i = 0; i < m_indices; i += 3) {
......@@ -142,15 +144,17 @@ void CVK::Geometry::computeTangents() {
}
}
std::vector<glm::vec4>* CVK::Geometry::getVertices() { return &m_vertices; }
std::vector<glm::vec4>* Geometry::getVertices() { return &m_vertices; }
std::vector<glm::vec3>* Geometry::getNormals() { return &m_normals; }
std::vector<glm::vec3>* CVK::Geometry::getNormals() { return &m_normals; }
std::vector<glm::vec2>* Geometry::getUVs() { return &m_uvs; }
std::vector<glm::vec2>* CVK::Geometry::getUVs() { return &m_uvs; }
std::vector<unsigned int>* Geometry::getIndex() { return &m_index; }
std::vector<unsigned int>* CVK::Geometry::getIndex() { return &m_index; }
std::vector<glm::vec3>* Geometry::getTangents() { return &m_tangents; }
GLuint Geometry::getVAO() const { return m_vao; }
int Geometry::getNumIndices() const { return m_indices; }
int Geometry::getNumVertexAttrib() const { return m_num_attribs; }
std::vector<glm::vec3>* CVK::Geometry::getTangents() { return &m_tangents; }
GLuint CVK::Geometry::getVAO() const { return m_vao; }
int CVK::Geometry::getNumIndices() const { return m_indices; }
int CVK::Geometry::getNumVertexAttrib() const { return m_num_attribs; }
} // namespace CVK
\ No newline at end of file
#include <CVK_2/CVK_Light.h>
namespace CVK {
// parameters like in OpenGL 1.1 (s. spec)
CVK::Light::Light() {
Light::Light() {
m_position = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f);
m_color = glm::vec3(1.0f, 1.0f, 1.0f);
m_spotDirection = glm::vec3(0.0f, 1.0f, 0.0f);
;
m_spotExponent = 1.0f;
m_spotCutoff = 0.0f;
}
CVK::Light::Light(glm::vec4 pos, glm::vec3 col, glm::vec3 s_dir, float s_exp,
float s_cut) {
Light::Light(glm::vec4 pos, glm::vec3 col, glm::vec3 s_dir, float s_exp,
float s_cut) {
m_position = pos;
m_color = col;
m_spotDirection = s_dir;
......@@ -19,28 +21,30 @@ CVK::Light::Light(glm::vec4 pos, glm::vec3 col, glm::vec3 s_dir, float s_exp,
m_spotCutoff = s_cut;
}
CVK::Light::~Light() {}
Light::~Light() {}
void CVK::Light::setPosition(glm::vec4 pos) { m_position = pos; }
void Light::setPosition(glm::vec4 pos) { m_position = pos; }
glm::vec4* CVK::Light::getPosition() { return &m_position; }
glm::vec4* Light::getPosition() { return &m_position; }
void CVK::Light::setColor(glm::vec3 col) { m_color = col; }
void Light::setColor(glm::vec3 col) { m_color = col; }
glm::vec3* CVK::Light::getColor() { return &m_color; }
glm::vec3* Light::getColor() { return &m_color; }
void CVK::Light::setSpotDirection(glm::vec3 direction) {
void Light::setSpotDirection(glm::vec3 direction) {
m_spotDirection = direction;
}
glm::vec3* CVK::Light::getSpotDirection() { return &m_spotDirection; }
glm::vec3* Light::getSpotDirection() { return &m_spotDirection; }
void CVK::Light::setSpotExponent(float spotExponent) {
void Light::setSpotExponent(float spotExponent) {
m_spotExponent = spotExponent;
}
float CVK::Light::getSpotExponent() const { return m_spotExponent; }
float Light::getSpotExponent() const { return m_spotExponent; }
void Light::setSpotCutoff(float spotCutoff) { m_spotCutoff = spotCutoff; }
void CVK::Light::setSpotCutoff(float spotCutoff) { m_spotCutoff = spotCutoff; }
float Light::getSpotCutoff() const { return m_spotCutoff; }
float CVK::Light::getSpotCutoff() const { return m_spotCutoff; }
} // namespace CVK
\ No newline at end of file
#include <CVK_2/CVK_Material.h>
CVK::Material::Material(glm::vec3 diffuse, glm::vec3 specular,
float shininess) {
namespace CVK {
Material::Material(glm::vec3 diffuse, glm::vec3 specular, float shininess) {
init(1.f, diffuse, 1.f, specular, shininess);
}
CVK::Material::Material(float kd, glm::vec3 diffuse) {
Material::Material(float kd, glm::vec3 diffuse) {
init(kd, diffuse, 0.f, BLACK, 0.f);
}
CVK::Material::Material(float kd, glm::vec3 diffuse, float ks,
glm::vec3 specular, float shininess) {
Material::Material(float kd, glm::vec3 diffuse, float ks, glm::vec3 specular,
float shininess) {
init(kd, diffuse, ks, specular, shininess);
}
CVK::Material::Material(const std::string colorTexturePath, float kd) {
Material::Material(const std::string colorTexturePath, float kd) {
init(kd, WHITE, 0.f, BLACK, 0.f);
setTexture(COLOR_TEXTURE, colorTexturePath);
}
CVK::Material::Material(GLuint colorTextureID, float kd) {
Material::Material(GLuint colorTextureID, float kd) {
init(kd, WHITE, 0.f, BLACK, 0.f);
setTexture(COLOR_TEXTURE, colorTextureID);
}
CVK::Material::Material(const std::string colorTexturePath, float kd, float ks,
glm::vec3 specular, float shininess) {
Material::Material(const std::string colorTexturePath, float kd, float ks,
glm::vec3 specular, float shininess) {
init(kd, WHITE, ks, specular, shininess);
setTexture(COLOR_TEXTURE, colorTexturePath);
}
CVK::Material::Material(GLuint colorTextureID, float kd, float ks,
glm::vec3 specular, float shininess) {
Material::Material(GLuint colorTextureID, float kd, float ks,
glm::vec3 specular, float shininess) {
init(kd, WHITE, ks, specular, shininess);
setTexture(COLOR_TEXTURE, colorTextureID);
}
void CVK::Material::init(float kd, glm::vec3 diffuse, float ks,
glm::vec3 specular, float shininess) {
void Material::init(float kd, glm::vec3 diffuse, float ks, glm::vec3 specular,
float shininess) {
m_kd = kd;
m_ks = ks;
m_diffColor = diffuse;
......@@ -47,36 +48,36 @@ void CVK::Material::init(float kd, glm::vec3 diffuse, float ks,
m_ior = 0;
}
CVK::Material::~Material() {}
Material::~Material() {}
void CVK::Material::setKd(float kd) { m_kd = kd; }
void Material::setKd(float kd) { m_kd = kd; }
float CVK::Material::getKd() const { return m_kd; }
float Material::getKd() const { return m_kd; }
void CVK::Material::setKs(float ks) { m_ks = ks; }
void Material::setKs(float ks) { m_ks = ks; }
float CVK::Material::getKs() const { return m_ks; }
void CVK::Material::setKt(float kt) { m_kt = kt; }
float Material::getKs() const { return m_ks; }
void Material::setKt(float kt) { m_kt = kt; }
float CVK::Material::getKt() const { return m_kt; }
float Material::getKt() const { return m_kt; }
void CVK::Material::setdiffColor(glm::vec3 col) { m_diffColor = col; }
void Material::setdiffColor(glm::vec3 col) { m_diffColor = col; }
glm::vec3* CVK::Material::getdiffColor() { return &m_diffColor; }
glm::vec3* Material::getdiffColor() { return &m_diffColor; }
void CVK::Material::setspecColor(glm::vec3 col) { m_specColor = col; }
void Material::setspecColor(glm::vec3 col) { m_specColor = col; }
glm::vec3* CVK::Material::getspecColor() { return &m_specColor; }
glm::vec3* Material::getspecColor() { return &m_specColor; }
void CVK::Material::setShininess(float shininess) { m_shininess = shininess; }
void Material::setShininess(float shininess) { m_shininess = shininess; }
float CVK::Material::getShininess() const { return m_shininess; }
float Material::getShininess() const { return m_shininess; }
void CVK::Material::setIor(float ior) { m_ior = ior; }
void Material::setIor(float ior) { m_ior = ior; }
float CVK::Material::getIor() const { return m_ior; }
float Material::getIor() const { return m_ior; }
void CVK::Material::setTexture(TextureType type, const std::string fileName) {
void Material::setTexture(TextureType type, const std::string fileName) {
switch (type) {
case COLOR_TEXTURE:
if (m_colorTexture)
......@@ -93,7 +94,7 @@ void CVK::Material::setTexture(TextureType type, const std::string fileName) {
}
}
void CVK::Material::setTexture(TextureType type, GLuint textureID) {
void Material::setTexture(TextureType type, GLuint textureID) {
switch (type) {
case COLOR_TEXTURE:
if (m_colorTexture)
......@@ -110,7 +111,7 @@ void CVK::Material::setTexture(TextureType type, GLuint textureID) {
}
}
bool CVK::Material::hasTexture(TextureType type) const {
bool Material::hasTexture(TextureType type) const {
switch (type) {
case COLOR_TEXTURE: