GLM-related Shader.uniformNf overloads
This commit is contained in:
@@ -41,11 +41,20 @@ void Shader::uniform2f(std::string name, float x, float y){
|
||||
glUniform2f(transformLoc, x, y);
|
||||
}
|
||||
|
||||
void Shader::uniform2f(std::string name, glm::vec2 xy){
|
||||
GLuint transformLoc = glGetUniformLocation(id, name.c_str());
|
||||
glUniform2f(transformLoc, xy.x, xy.y);
|
||||
}
|
||||
|
||||
void Shader::uniform3f(std::string name, float x, float y, float z){
|
||||
GLuint transformLoc = glGetUniformLocation(id, name.c_str());
|
||||
glUniform3f(transformLoc, x,y,z);
|
||||
}
|
||||
|
||||
void Shader::uniform3f(std::string name, glm::vec3 xyz){
|
||||
GLuint transformLoc = glGetUniformLocation(id, name.c_str());
|
||||
glUniform3f(transformLoc, xyz.x, xyz.y, xyz.z);
|
||||
}
|
||||
|
||||
|
||||
Shader* load_shader(std::string vertexFile, std::string fragmentFile) {
|
||||
|
||||
@@ -16,7 +16,9 @@ public:
|
||||
void uniform1i(std::string name, int x);
|
||||
void uniform1f(std::string name, float x);
|
||||
void uniform2f(std::string name, float x, float y);
|
||||
void uniform2f(std::string name, glm::vec2 xy);
|
||||
void uniform3f(std::string name, float x, float y, float z);
|
||||
void uniform3f(std::string name, glm::vec3 xyz);
|
||||
};
|
||||
|
||||
extern Shader* load_shader(std::string vertexFile, std::string fragmentFile);
|
||||
|
||||
Reference in New Issue
Block a user