aboutsummaryrefslogtreecommitdiff
path: root/src/shader/wrap/graphic_shader.h
blob: dcae6db5fda6c24a19e5b5c4c20f90bb2021ebbf (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
#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& geometry, const std::string fragment);
	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;
};