summaryrefslogtreecommitdiffhomepage
path: root/src/shader.hpp
blob: 057cd5f1697d5adf5cc7fc5a30d4a4657b035aac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once

// external libs
#include "glad/glad.h"
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "glm/gtc/type_ptr.hpp"

// std libs
#include <string>

namespace Ogle
{
	class Shader
	{
		public:
			// id of the shader program
			unsigned int ID;

			Shader(const char* vertexPath, const char* fragmentPath);

			// activate the shader
			void use();

			// utility setter functions for uniforms
			void setBool(const std::string &name, bool value) const;
			void setInt(const std::string &name, int value) const;
			void set1f(const std::string &name, float value) const;
			void set4f(
					const std::string &name,
					float value0,
					float value1,
					float value2,
					float value3
					) const;
			void setMatrix4fv(const std::string &name, glm::mat4 matrix);
	};
}