diff options
author | bubnikv <bubnikv@gmail.com> | 2018-09-19 12:02:24 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-09-19 12:02:24 +0300 |
commit | 0558b53493a77bae44831cf87bb0f59359828ef5 (patch) | |
tree | c3e8dbdf7d91a051c12d9ebbf7606d41047fea96 /src/slic3r/GUI/GLShader.hpp | |
parent | 3ddaccb6410478ad02d8c0e02d6d8e6eb1785b9f (diff) |
WIP: Moved sources int src/, separated most of the source code from Perl.
The XS was left only for the unit / integration tests, and it links
libslic3r only. No wxWidgets are allowed to be used from Perl starting
from now.
Diffstat (limited to 'src/slic3r/GUI/GLShader.hpp')
-rw-r--r-- | src/slic3r/GUI/GLShader.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/slic3r/GUI/GLShader.hpp b/src/slic3r/GUI/GLShader.hpp new file mode 100644 index 000000000..803b2f154 --- /dev/null +++ b/src/slic3r/GUI/GLShader.hpp @@ -0,0 +1,41 @@ +#ifndef slic3r_GLShader_hpp_ +#define slic3r_GLShader_hpp_ + +#include "../../libslic3r/libslic3r.h" +#include "../../libslic3r/Point.hpp" + +namespace Slic3r { + +class GLShader +{ +public: + GLShader() : + fragment_program_id(0), + vertex_program_id(0), + shader_program_id(0) + {} + ~GLShader(); + + bool load_from_text(const char *fragment_shader, const char *vertex_shader); + bool load_from_file(const char* fragment_shader_filename, const char* vertex_shader_filename); + + void release(); + + int get_attrib_location(const char *name) const; + int get_uniform_location(const char *name) const; + + bool set_uniform(const char *name, float value) const; + bool set_uniform(const char* name, const float* matrix) const; + + void enable() const; + void disable() const; + + unsigned int fragment_program_id; + unsigned int vertex_program_id; + unsigned int shader_program_id; + std::string last_error; +}; + +} + +#endif /* slic3r_GLShader_hpp_ */ |