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

#include <string>

#include <GL/glew.h>

class ComputeShader {
private:
	const GLuint _id;

	bool _good;

public:
	struct Guard {
		const GLuint _id;

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

	Guard use() const;

	ComputeShader(const std::string& src);
	~ComputeShader();

	bool isGood() const;

	GLuint setUniform(const std::string& name, float x, float y) const;

	void workOn(GLuint buffer) const;
	void dispatch(std::size_t dimX) const;
};