2016-02-07 22:32:38 +00:00
|
|
|
//
|
|
|
|
// Shader.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 07/02/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Shader_hpp
|
|
|
|
#define Shader_hpp
|
|
|
|
|
2016-02-08 00:21:22 +00:00
|
|
|
#include "OpenGL.hpp"
|
|
|
|
|
2016-02-07 22:32:38 +00:00
|
|
|
namespace OpenGL {
|
|
|
|
class Shader {
|
|
|
|
public:
|
|
|
|
Shader(const char *vertex_shader, const char *fragment_shader);
|
|
|
|
~Shader();
|
|
|
|
|
|
|
|
void bind();
|
2016-02-08 00:21:22 +00:00
|
|
|
GLint get_attrib_location(const char *name);
|
|
|
|
GLint get_uniform_location(const char *name);
|
|
|
|
|
|
|
|
private:
|
|
|
|
GLuint compile_shader(const char *source, GLenum type);
|
|
|
|
GLuint _shader_program;
|
2016-02-07 22:32:38 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Shader_hpp */
|