aboutsummaryrefslogtreecommitdiff
path: root/src/shader/wrap/graphic_shader.h
blob: 25a5efbb4ebe665d8e1664018d7be7b75aacf639 (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
#pragma once

#include <vector>
#include <string>

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

class GraphicShader {
private:
	const GLuint _id;

public:
	struct Guard {
		const GLuint _id;

		Guard(GLuint id);
		~Guard();
	};

	Guard use() const;

	GraphicShader(const std::string& vertex, const std::string fragment);
	~GraphicShader();

	GLuint setUniform(const std::string& name, int value) const;
	GLuint setUniform(const std::string& name, const std::vector<GLuint>& v) const;
	GLuint setUniform(const std::string& name, glm::mat4& M) const;
};