Skip to content
Snippets Groups Projects
Shader.h 640 B
Newer Older
#pragma once
#include <fstream>
#include <sstream>
#include <iostream>

#include <glm/glm.hpp>
#define GLEW_STATIC
#include <GL/glew.h>

class Shader {
public:
	GLint Id;
	Shader(const GLchar* vertexPath, const GLchar* fragmentPath);
	void Use() { glUseProgram(Id); };
	void setBool(const std::string& name, bool value) const { glUniform1i(glGetUniformLocation(Id, name.c_str()), (int)value); }
	void setInt(const std::string& name, int value) const { glUniform1i(glGetUniformLocation(Id, name.c_str()), value); }
	void setFloat(const std::string& name, float value) const { glUniform1f(glGetUniformLocation(Id, name.c_str()), value); }
};