From c2920e0d70fd4f077e12377da78d9b31b95d0e49 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Thu, 11 Aug 2016 13:01:52 +0300 Subject: [PATCH] Make sure that the textures are drawn in colors expected --- src/Surfaces/GridWarpSurface.cpp | 5 +++++ src/Surfaces/QuadSurface.cpp | 10 ++++++++++ src/Surfaces/TriangleSurface.cpp | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/src/Surfaces/GridWarpSurface.cpp b/src/Surfaces/GridWarpSurface.cpp index 30643fc..e2ad6af 100644 --- a/src/Surfaces/GridWarpSurface.cpp +++ b/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(); } diff --git a/src/Surfaces/QuadSurface.cpp b/src/Surfaces/QuadSurface.cpp index b9b5af8..933b173 100644 --- a/src/Surfaces/QuadSurface.cpp +++ b/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(); } diff --git a/src/Surfaces/TriangleSurface.cpp b/src/Surfaces/TriangleSurface.cpp index ca6b03c..3d0d937 100644 --- a/src/Surfaces/TriangleSurface.cpp +++ b/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(); }