diff --git a/src/Surfaces/BaseSurface.cpp b/src/Surfaces/BaseSurface.cpp index 4e72e49..8e679fe 100644 --- a/src/Surfaces/BaseSurface.cpp +++ b/src/Surfaces/BaseSurface.cpp @@ -5,7 +5,6 @@ namespace piMapper { BaseSurface::BaseSurface(){ _moved = false; - ofEnableNormalizedTexCoords(); createDefaultTexture(); } diff --git a/src/Surfaces/GridWarpSurface.cpp b/src/Surfaces/GridWarpSurface.cpp index fd1c332..30643fc 100644 --- a/src/Surfaces/GridWarpSurface.cpp +++ b/src/Surfaces/GridWarpSurface.cpp @@ -18,9 +18,16 @@ void GridWarpSurface::draw(){ return; } + bool normalizedTexCoords = ofGetUsingNormalizedTexCoords(); + ofEnableNormalizedTexCoords(); + source->getTexture()->bind(); mesh.draw(); source->getTexture()->unbind(); + + if(!normalizedTexCoords){ + ofDisableNormalizedTexCoords(); + } } void GridWarpSurface::moveBy(ofVec2f v){ diff --git a/src/Surfaces/QuadSurface.cpp b/src/Surfaces/QuadSurface.cpp index 26b2b2b..b9b5af8 100644 --- a/src/Surfaces/QuadSurface.cpp +++ b/src/Surfaces/QuadSurface.cpp @@ -78,16 +78,30 @@ void QuadSurface::draw(){ ofPushMatrix(); if(true){ + bool normalizedTexCoords = ofGetUsingNormalizedTexCoords(); + ofEnableNormalizedTexCoords(); + glMultMatrixf(_matrix); source->getTexture()->bind(); m.draw(); source->getTexture()->unbind(); + + if(!normalizedTexCoords){ + ofDisableNormalizedTexCoords(); + } } ofPopMatrix(); }else{ + bool normalizedTexCoords = ofGetUsingNormalizedTexCoords(); + ofEnableNormalizedTexCoords(); + source->getTexture()->bind(); mesh.draw(); source->getTexture()->unbind(); + + if(!normalizedTexCoords){ + ofDisableNormalizedTexCoords(); + } } } diff --git a/src/Surfaces/TriangleSurface.cpp b/src/Surfaces/TriangleSurface.cpp index bf49a0a..ca6b03c 100644 --- a/src/Surfaces/TriangleSurface.cpp +++ b/src/Surfaces/TriangleSurface.cpp @@ -50,10 +50,17 @@ void TriangleSurface::draw(){ if(!source->getTexture()->isAllocated()){ return; } + + bool normalizedTexCoords = ofGetUsingNormalizedTexCoords(); + ofEnableNormalizedTexCoords(); source->getTexture()->bind(); mesh.draw(); source->getTexture()->unbind(); + + if(!normalizedTexCoords){ + ofDisableNormalizedTexCoords(); + } } void TriangleSurface::setVertex(int index, ofVec2f p){