Skip to content

Commit

Permalink
load texture into shader
Browse files Browse the repository at this point in the history
  • Loading branch information
underdoeg committed Aug 11, 2014
1 parent b94e658 commit d8dd44e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ void Material::begin() {
}

for(ofShader* shader: shaders) {
if(shader->isLoaded())
if(shader->isLoaded()) {
shader->begin();
if(textures.size()>0) {
if(textures[0]->img.isAllocated()) {
shader->setUniformTexture("tex0", textures[0]->img.getTextureReference(), 0);
}
}
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ bool Object::isVisible() {
}

void Object::hide() {
if(!visible)
return;
visible = false;
ObjectEventArgs args;
args.obj = this;
ofNotifyEvent(onHide, args);
}

void Object::show() {
if(visible)
return;
visible = true;
ObjectEventArgs args;
args.obj = this;
Expand Down

0 comments on commit d8dd44e

Please # to comment.