diff --git a/example/src/main.cpp b/example/src/main.cpp index ad3c2af..2c8ec5b 100644 --- a/example/src/main.cpp +++ b/example/src/main.cpp @@ -15,24 +15,8 @@ int main(int argc, char * argv[]){ } } - shared_ptr window; -#ifdef TARGET_OPENGLES - ofGLESWindowSettings esSettings; - esSettings.glesVersion = 2; - esSettings.width = 1440; - esSettings.height = 900; - window = ofCreateWindow(esSettings); -#else - ofGLWindowSettings glSettings; - glSettings.glVersionMajor = 2; - glSettings.glVersionMinor = 1; - glSettings.width = 1440; - glSettings.height = 900; - window = ofCreateWindow(glSettings); -#endif - - auto app = std::make_shared(); Settings::instance()->setFullscreen(fullscreen); - ofRunApp(window, app); - ofRunMainLoop(); + + ofSetupOpenGL(1024, 768, OF_WINDOW); + ofRunApp(new ofApp()); } diff --git a/src/Surfaces/CircleSurface.cpp b/src/Surfaces/CircleSurface.cpp index a636dc8..4d7f9ec 100644 --- a/src/Surfaces/CircleSurface.cpp +++ b/src/Surfaces/CircleSurface.cpp @@ -183,6 +183,23 @@ void CircleSurface::draw() { ofClear(0, 0, 0, 0); ofSetupScreenOrtho(w, h, -1, 1); ofEnableNormalizedTexCoords(); + ofSetColor(255); + ofFill(); + ofSetRectMode(OF_RECTMODE_CORNER); +#ifdef TARGET_RASPBERRY_PI + scaledSourceFbo.getTexture().bind(); + maskMesh.draw(); + scaledSourceFbo.getTexture().unbind(); + + // Masking without shaders... + ofPushStyle(); + ofEnableBlendMode(OF_BLENDMODE_MULTIPLY); + ofSetColor(255); + ofFill(); + ofDisableNormalizedTexCoords(); + maskFbo.draw(0, 0); + ofPopStyle(); +#else maskShader.begin(); maskShader.setUniformTexture("maskTex", maskFbo.getTexture(), 1); ofSetColor(255); @@ -192,6 +209,8 @@ void CircleSurface::draw() { maskMesh.draw(); scaledSourceFbo.getTexture().unbind(); maskShader.end(); +#endif + } outputFbo.end();