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();
ofEnableNormalizedTexCoords();
ofPushStyle();
ofSetColor(255, 255, 255);
source->getTexture()->bind();
mesh.draw();
source->getTexture()->unbind();
ofPopStyle();
if(!normalizedTexCoords){
ofDisableNormalizedTexCoords();
}

10
src/Surfaces/QuadSurface.cpp

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

5
src/Surfaces/TriangleSurface.cpp

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

Loading…
Cancel
Save