Skip to content

Commit 45c3458

Browse files
feat(ofShader): allow setting uniform3f from ofFloatColor (#8362)
Co-authored-by: alexandre burton <[email protected]>
1 parent 1da7753 commit 45c3458

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

libs/openFrameworks/gl/ofShader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,11 @@ void ofShader::setUniform4f(const string & name, const glm::vec4 & v) const {
10651065
setUniform4f(name, v.x, v.y, v.z, v.w);
10661066
}
10671067

1068+
//--------------------------------------------------------------
1069+
void ofShader::setUniform3f(const string & name, const ofFloatColor & v) const {
1070+
setUniform3f(name, v.r, v.g, v.b);
1071+
}
1072+
10681073
//--------------------------------------------------------------
10691074
void ofShader::setUniform4f(const string & name, const ofFloatColor & v) const {
10701075
setUniform4f(name, v.r, v.g, v.b, v.a);

libs/openFrameworks/gl/ofShader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class ofShader {
174174
void setUniform2f(const std::string & name, const glm::vec2 & v) const;
175175
void setUniform3f(const std::string & name, const glm::vec3 & v) const;
176176
void setUniform4f(const std::string & name, const glm::vec4 & v) const;
177+
void setUniform3f(const std::string & name, const ofFloatColor & v) const;
177178
void setUniform4f(const std::string & name, const ofFloatColor & v) const;
178179

179180
// set an array of uniform values

0 commit comments

Comments
 (0)