summary refs log tree commit diff
path: root/src/Shader/ShaderProgram.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Shader/ShaderProgram.cpp')
-rw-r--r--src/Shader/ShaderProgram.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/Shader/ShaderProgram.cpp b/src/Shader/ShaderProgram.cpp
deleted file mode 100644
index 4d0b684..0000000
--- a/src/Shader/ShaderProgram.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <GL/glew.h>
-#include <stdexcept>
-#include "ShaderProgram.hpp"
-
-namespace MC {
-
-ShaderProgram::ShaderProgram(Shader fragment, Shader vertex) {
-    m_program = glCreateProgram();
-
-    glAttachShader(m_program, fragment.get());
-    glAttachShader(m_program, vertex.get());
-
-    glLinkProgram(m_program);
-
-    glDeleteShader(fragment.get());
-    glDeleteShader(vertex.get());
-
-    GLint success;
-    glGetProgramiv(m_program, GL_LINK_STATUS, &success);
-    if(!success) {
-        char message[512] = {};
-        glGetProgramInfoLog(m_program, 512, nullptr, message);
-
-        throw std::runtime_error(message);
-    }
-}
-
-void ShaderProgram::bind() const {
-    glUseProgram(m_program);
-}
-
-Uniform ShaderProgram::uniform(const std::string& name) const {
-    auto index = glGetUniformLocation(m_program, name.c_str());
-
-    return {name, static_cast<uint32_t>(index)};
-}
-
-uint32_t ShaderProgram::get() const {
-    return m_program;
-}
-
-}