Browse Source

Make sure that the textures are drawn in colors expected

master
Krisjanis Rijnieks 9 years ago
parent
commit
c2920e0d70
  1. 5
      src/Surfaces/GridWarpSurface.cpp
  2. 10
      src/Surfaces/QuadSurface.cpp
  3. 5
      src/Surfaces/TriangleSurface.cpp

5
src/Surfaces/GridWarpSurface.cpp

@ -21,10 +21,15 @@ void GridWarpSurface::draw(){
bool normalizedTexCoords = ofGetUsingNormalizedTexCoords(); bool normalizedTexCoords = ofGetUsingNormalizedTexCoords();
ofEnableNormalizedTexCoords(); ofEnableNormalizedTexCoords();
ofPushStyle();
ofSetColor(255, 255, 255);
source->getTexture()->bind(); source->getTexture()->bind();
mesh.draw(); mesh.draw();
source->getTexture()->unbind(); source->getTexture()->unbind();
ofPopStyle();
if(!normalizedTexCoords){ if(!normalizedTexCoords){
ofDisableNormalizedTexCoords(); ofDisableNormalizedTexCoords();
} }

10
src/Surfaces/QuadSurface.cpp

@ -81,11 +81,16 @@ void QuadSurface::draw(){
bool normalizedTexCoords = ofGetUsingNormalizedTexCoords(); bool normalizedTexCoords = ofGetUsingNormalizedTexCoords();
ofEnableNormalizedTexCoords(); ofEnableNormalizedTexCoords();
ofPushStyle();
ofSetColor(255, 255, 255);
glMultMatrixf(_matrix); glMultMatrixf(_matrix);
source->getTexture()->bind(); source->getTexture()->bind();
m.draw(); m.draw();
source->getTexture()->unbind(); source->getTexture()->unbind();
ofPopStyle();
if(!normalizedTexCoords){ if(!normalizedTexCoords){
ofDisableNormalizedTexCoords(); ofDisableNormalizedTexCoords();
} }
@ -94,11 +99,16 @@ void QuadSurface::draw(){
}else{ }else{
bool normalizedTexCoords = ofGetUsingNormalizedTexCoords(); bool normalizedTexCoords = ofGetUsingNormalizedTexCoords();
ofEnableNormalizedTexCoords(); ofEnableNormalizedTexCoords();
ofPushStyle();
ofSetColor(255, 255, 255);
source->getTexture()->bind(); source->getTexture()->bind();
mesh.draw(); mesh.draw();
source->getTexture()->unbind(); source->getTexture()->unbind();
ofPopStyle();
if(!normalizedTexCoords){ if(!normalizedTexCoords){
ofDisableNormalizedTexCoords(); ofDisableNormalizedTexCoords();
} }

5
src/Surfaces/TriangleSurface.cpp

@ -53,11 +53,16 @@ void TriangleSurface::draw(){
bool normalizedTexCoords = ofGetUsingNormalizedTexCoords(); bool normalizedTexCoords = ofGetUsingNormalizedTexCoords();
ofEnableNormalizedTexCoords(); ofEnableNormalizedTexCoords();
ofPushStyle();
ofSetColor(255, 255, 255);
source->getTexture()->bind(); source->getTexture()->bind();
mesh.draw(); mesh.draw();
source->getTexture()->unbind(); source->getTexture()->unbind();
ofPopStyle();
if(!normalizedTexCoords){ if(!normalizedTexCoords){
ofDisableNormalizedTexCoords(); ofDisableNormalizedTexCoords();
} }

Loading…
Cancel
Save