blob: 816b925a55ae033b2a2685354010e304c7928479 (
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
|
#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;
GLuint setUniform(const std::string& name, unsigned int value) const;
void workOn(GLuint bufferA, GLuint bufferB, GLuint bufferC) const;
void dispatch(GLuint nX, GLuint nY) const;
};
|