Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created July 11, 2011 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roxlu/1075582 to your computer and use it in GitHub Desktop.
Save roxlu/1075582 to your computer and use it in GitHub Desktop.
//----------------------------------------
void ofLight::setAmbientColor(const ofFloatColor& c) {
if(glIndex==-1) return;
ambientColor = c;
glLightfv(GL_LIGHT0 + glIndex, GL_AMBIENT, &c.r);
}
//----------------------------------------
void ofLight::setDiffuseColor(const ofFloatColor& c) {
if(glIndex==-1) return;
diffuseColor = c;
glLightfv(GL_LIGHT0 + glIndex, GL_DIFFUSE, &c.r);
}
//----------------------------------------
void ofLight::setSpecularColor(const ofFloatColor& c) {
if(glIndex==-1) return;
specularColor = c;
glLightfv(GL_LIGHT0 + glIndex, GL_SPECULAR, &c.r);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment