aboutsummaryrefslogtreecommitdiffstats
path: root/yage/render/shader.h
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-06-23 15:49:21 +0100
committerYann Herklotz <ymherklotz@gmail.com>2018-06-23 15:49:21 +0100
commit9f92cab6b884711ca8be050b500a2880a955f001 (patch)
treefa0999a72436a81c82c49ba8dc473522ac30ceb6 /yage/render/shader.h
parent3702e753a5f7b31c31261c968757e19e808a84ec (diff)
downloadYAGE-9f92cab6b884711ca8be050b500a2880a955f001.tar.gz
YAGE-9f92cab6b884711ca8be050b500a2880a955f001.zip
Switching to east const
This is compared to const west, which is not very consistent, as const always acts on what is on its left, and if there isn't anything on the left, it will act on what is on its right. By always placing const on the right of what it should act on, the rule becomes more consistent.
Diffstat (limited to 'yage/render/shader.h')
-rw-r--r--yage/render/shader.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/yage/render/shader.h b/yage/render/shader.h
index d91753cb..75a24c6d 100644
--- a/yage/render/shader.h
+++ b/yage/render/shader.h
@@ -20,7 +20,7 @@ namespace yage
class Shader
{
public:
- Shader(const std::string &vertex_path, const std::string &fragment_path);
+ Shader(std::string const &vertex_path, std::string const &fragment_path);
Shader(const Shader &) = delete;
Shader(Shader &&) = delete;
~Shader();
@@ -32,16 +32,16 @@ public:
void use() const;
/// set uniforms of different type
- void setUniform(const std::string &name, int value) const;
- void setUniform(const std::string &name, float value) const;
- void setUniform(const std::string &name, const glm::mat4 &matrix) const;
+ void setUniform(std::string const &name, int value) const;
+ void setUniform(std::string const &name, float value) const;
+ void setUniform(std::string const &name, const glm::mat4 &matrix) const;
private:
/// compiled shader program id
GLuint program_id_ = 0;
- GLint getUniformLocation(const std::string &uniform_name) const;
- void errorCheck(GLuint shader, const std::string &shader_type) const;
+ GLint getUniformLocation(std::string const &uniform_name) const;
+ void errorCheck(GLuint shader, std::string const &shader_type) const;
};
} // namespace yage