summary refs log tree commit diff
path: root/src/GFX/Shading
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-07-07 23:05:14 +0200
committerMel <einebeere@gmail.com>2023-07-07 23:14:59 +0200
commit129f2e421e16bd008cdca8713cc91f67d103d94e (patch)
treea4d3e1005c57591b44fd57be4c1b00441512e36d /src/GFX/Shading
parentf1fc192ddc4c739fa8b4b376c759b7d3218a34eb (diff)
downloadmeowcraft-129f2e421e16bd008cdca8713cc91f67d103d94e.tar.zst
meowcraft-129f2e421e16bd008cdca8713cc91f67d103d94e.zip
Fix minor quality issues
Diffstat (limited to 'src/GFX/Shading')
-rw-r--r--src/GFX/Shading/Program.hpp2
-rw-r--r--src/GFX/Shading/Shader.cpp4
-rw-r--r--src/GFX/Shading/Uniform.cpp4
-rw-r--r--src/GFX/Shading/Uniform.hpp7
4 files changed, 7 insertions, 10 deletions
diff --git a/src/GFX/Shading/Program.hpp b/src/GFX/Shading/Program.hpp
index 6b28de0..8a50617 100644
--- a/src/GFX/Shading/Program.hpp
+++ b/src/GFX/Shading/Program.hpp
@@ -1,9 +1,7 @@
 #pragma once
 
 #include <string>
-#include <vector>
 #include "Shader.hpp"
-#include "../../Math/Common.hpp"
 #include "Uniform.hpp"
 
 namespace MC::GFX::Shading {
diff --git a/src/GFX/Shading/Shader.cpp b/src/GFX/Shading/Shader.cpp
index f1502c2..6dfac34 100644
--- a/src/GFX/Shading/Shader.cpp
+++ b/src/GFX/Shading/Shader.cpp
@@ -4,8 +4,8 @@
 
 namespace MC::GFX::Shading {
 
-Shader::Shader(Shader::Type type, const char* source) {
-    uint32_t gl_type;
+Shader::Shader(Type type, const char* source) {
+    uint32_t gl_type = 0;
     switch (type) {
         case Type::Vertex:
             gl_type = GL_VERTEX_SHADER;
diff --git a/src/GFX/Shading/Uniform.cpp b/src/GFX/Shading/Uniform.cpp
index 9448574..71786ef 100644
--- a/src/GFX/Shading/Uniform.cpp
+++ b/src/GFX/Shading/Uniform.cpp
@@ -3,11 +3,11 @@
 
 namespace MC::GFX::Shading {
 
-void Uniform::set(Matrix<4, 4> value) const {
+void Uniform::set(const Matrix<4, 4>& value) const {
     glUniformMatrix4fv(m_index, 1, GL_TRUE, value.elements);
 }
 
-void Uniform::set(Vector<3> value) const {
+void Uniform::set(const Vector<3>& value) const {
     glUniform3f(m_index, value.x(), value.y(), value.z());
 }
 
diff --git a/src/GFX/Shading/Uniform.hpp b/src/GFX/Shading/Uniform.hpp
index 3c14315..a270e65 100644
--- a/src/GFX/Shading/Uniform.hpp
+++ b/src/GFX/Shading/Uniform.hpp
@@ -2,7 +2,6 @@
 
 #include <cstdint>
 #include <string>
-#include <utility>
 #include "../../Math/Common.hpp"
 
 namespace MC::GFX::Shading {
@@ -10,10 +9,10 @@ namespace MC::GFX::Shading {
 class Uniform {
 public:
     Uniform(std::string name, uint32_t index)
-        : m_name(std::move(name)), m_index(index) {};
+        : m_name(std::move(name)), m_index(index) {}
 
-    void set(Matrix<4, 4> value) const;
-    void set(Vector<3> value) const;
+    void set(const Matrix<4, 4>& value) const;
+    void set(const Vector<3>& value) const;
 
 private:
     std::string m_name;