2017-03-20 13:48:17 +00:00
|
|
|
#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();
|
|
|
|
|
2018-05-21 11:08:02 +00:00
|
|
|
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);
|
2018-06-12 10:18:16 +00:00
|
|
|
|
2017-03-20 13:48:17 +00:00
|
|
|
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;
|
|
|
|
|
|
|
|
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_ */
|