Added own shaders
This commit is contained in:
19
include/Shader.hpp
Normal file
19
include/Shader.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <GL/glew.h>
|
||||
#include "defines.hpp"
|
||||
|
||||
struct Shader {
|
||||
Shader(const char* vertexShaderFileName, const char* fragmentShaderFileName);
|
||||
virtual ~Shader();
|
||||
|
||||
void bind();
|
||||
void unbind();
|
||||
|
||||
private:
|
||||
GLuint compile(std::string shaderSource, GLenum shaderType);
|
||||
std::string parse(const char* filename);
|
||||
GLuint createShader(const char* vertexShaderFileName, const char* fragmentShaderFileName);
|
||||
|
||||
GLuint shaderId;
|
||||
};
|
||||
Reference in New Issue
Block a user