#ifndef PARTICLE_COMPUTE_SHADER #define PARTICLE_COMPUTE_SHADER #include #include #include #include #include /* OpenGL */ #include "glad/glad.h" #include class ComputeShader { private: std::string m_shader_filename{}; std::string m_shader_source{}; GLuint m_program = 0; GLuint m_shader = 0; public: ComputeShader() = default; ComputeShader(std::string &shader_filename); ~ComputeShader(); GLuint get_program() const; bool load(std::string shader_filename); bool compile(); void activate(); void deactivate(); void execute(int n); void wait(); bool release(); bool set_uniform(char const * name, float value); bool set_uniform(char const * name, int value); }; #endif // PARTICLE_COMPUTE_SHADER