Refactoring of GLShaderProgram::set_uniform() methods
This commit is contained in:
parent
7f9e519baf
commit
c30f5823f5
3 changed files with 81 additions and 114 deletions
|
@ -44,22 +44,39 @@ public:
|
|||
void start_using() const;
|
||||
void stop_using() const;
|
||||
|
||||
bool set_uniform(const char* name, int value) const;
|
||||
bool set_uniform(const char* name, bool value) const;
|
||||
bool set_uniform(const char* name, float value) const;
|
||||
bool set_uniform(const char* name, double value) const;
|
||||
bool set_uniform(const char* name, const std::array<int, 2>& value) const;
|
||||
bool set_uniform(const char* name, const std::array<int, 3>& value) const;
|
||||
bool set_uniform(const char* name, const std::array<int, 4>& value) const;
|
||||
bool set_uniform(const char* name, const std::array<float, 2>& value) const;
|
||||
bool set_uniform(const char* name, const std::array<float, 3>& value) const;
|
||||
bool set_uniform(const char* name, const std::array<float, 4>& value) const;
|
||||
bool set_uniform(const char* name, const float* value, size_t size) const;
|
||||
bool set_uniform(const char* name, const Transform3f& value) const;
|
||||
bool set_uniform(const char* name, const Transform3d& value) const;
|
||||
bool set_uniform(const char* name, const Matrix3f& value) const;
|
||||
bool set_uniform(const char* name, const Vec3f& value) const;
|
||||
bool set_uniform(const char* name, const Vec3d& value) const;
|
||||
void set_uniform(const char* name, int value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, bool value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, float value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, double value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const std::array<int, 2>& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const std::array<int, 3>& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const std::array<int, 4>& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const std::array<float, 2>& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const std::array<float, 3>& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const std::array<float, 4>& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const float* value, size_t size) const { set_uniform(get_uniform_location(name), value, size); }
|
||||
void set_uniform(const char* name, const Transform3f& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const Transform3d& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const Matrix3f& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const Vec3f& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
void set_uniform(const char* name, const Vec3d& value) const { set_uniform(get_uniform_location(name), value); }
|
||||
|
||||
void set_uniform(int id, int value) const;
|
||||
void set_uniform(int id, bool value) const;
|
||||
void set_uniform(int id, float value) const;
|
||||
void set_uniform(int id, double value) const;
|
||||
void set_uniform(int id, const std::array<int, 2>& value) const;
|
||||
void set_uniform(int id, const std::array<int, 3>& value) const;
|
||||
void set_uniform(int id, const std::array<int, 4>& value) const;
|
||||
void set_uniform(int id, const std::array<float, 2>& value) const;
|
||||
void set_uniform(int id, const std::array<float, 3>& value) const;
|
||||
void set_uniform(int id, const std::array<float, 4>& value) const;
|
||||
void set_uniform(int id, const float* value, size_t size) const;
|
||||
void set_uniform(int id, const Transform3f& value) const;
|
||||
void set_uniform(int id, const Transform3d& value) const;
|
||||
void set_uniform(int id, const Matrix3f& value) const;
|
||||
void set_uniform(int id, const Vec3f& value) const;
|
||||
void set_uniform(int id, const Vec3d& value) const;
|
||||
|
||||
// returns -1 if not found
|
||||
int get_attrib_location(const char* name) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue