summaryrefslogtreecommitdiffhomepage
path: root/src/shader.cpp
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-11-25 02:55:55 -0500
committerrealtradam <[email protected]>2022-11-25 02:55:55 -0500
commit4e7226ad1b081982e5cbed349edca1c5b0e1b779 (patch)
tree6d497896f979e6bbcb0841d33d3a2815333cfef9 /src/shader.cpp
parent6e1d0c6a3f3699e44000f411cd93261c460f75a9 (diff)
downloadOgle-4e7226ad1b081982e5cbed349edca1c5b0e1b779.tar.gz
Ogle-4e7226ad1b081982e5cbed349edca1c5b0e1b779.zip
fixed Makefile, implemented bunnymark
Diffstat (limited to 'src/shader.cpp')
-rw-r--r--src/shader.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shader.cpp b/src/shader.cpp
index 08da2a8..7542337 100644
--- a/src/shader.cpp
+++ b/src/shader.cpp
@@ -7,6 +7,10 @@
#include "glad/glad.h"
+#include <glm/glm.hpp>
+#include <glm/gtc/matrix_transform.hpp>
+#include <glm/gtc/type_ptr.hpp>
+
Shader::Shader(const char* vertexPath, const char* fragmentPath)
{
// 1. retrieve the vertex/fragment source code from filePath
@@ -108,3 +112,13 @@ void Shader::set4f(const std::string &name, float value0, float value1, float va
{
glUniform4f(glGetUniformLocation(ID, name.c_str()), value0, value1, value2, value3);
}
+
+void Shader::setMatrix4fv(const std::string &name, glm::mat4 matrix)
+{
+ glUniformMatrix4fv(
+ glGetUniformLocation(ID, name.c_str()),
+ 1,
+ GL_FALSE,
+ glm::value_ptr(matrix)
+ );
+}