From d64e53cdaf6a37c74edf6caa52d66826c6485e04 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Thu, 6 Oct 2022 16:21:09 -0300 Subject: [PATCH 1/6] dream operator fbo += --- libs/openFrameworks/gl/ofFbo.cpp | 8 ++++++++ libs/openFrameworks/gl/ofFbo.h | 1 + libs/openFrameworksCompiled/project/Makefile | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/libs/openFrameworks/gl/ofFbo.cpp b/libs/openFrameworks/gl/ofFbo.cpp index 3c3d16d8810..177bff9e579 100644 --- a/libs/openFrameworks/gl/ofFbo.cpp +++ b/libs/openFrameworks/gl/ofFbo.cpp @@ -302,6 +302,14 @@ ofFbo::ofFbo(const ofFbo & mom){ } } +//-------------------------------------------------------------- +void ofFbo::operator+=(const ofFbo & mom){ + this->begin(); + ofSetColor(255); + mom.draw(0,0); + this->end(); +} + //-------------------------------------------------------------- ofFbo & ofFbo::operator=(const ofFbo & mom){ if(&mom==this) return *this; diff --git a/libs/openFrameworks/gl/ofFbo.h b/libs/openFrameworks/gl/ofFbo.h index 2ec3ad43781..7fab6294edf 100644 --- a/libs/openFrameworks/gl/ofFbo.h +++ b/libs/openFrameworks/gl/ofFbo.h @@ -48,6 +48,7 @@ class ofFbo : public ofBaseDraws, public ofBaseHasTexture { ofFbo(); ofFbo(const ofFbo & mom); ofFbo & operator=(const ofFbo & fbo); + void operator+=(const ofFbo & fbo); ofFbo(ofFbo && mom); ofFbo & operator=(ofFbo && fbo); virtual ~ofFbo(); diff --git a/libs/openFrameworksCompiled/project/Makefile b/libs/openFrameworksCompiled/project/Makefile index 0e53bc058c7..c320bd0242a 100644 --- a/libs/openFrameworksCompiled/project/Makefile +++ b/libs/openFrameworksCompiled/project/Makefile @@ -14,6 +14,12 @@ # define the OF_SHARED_MAKEFILES location OF_SHARED_MAKEFILES_PATH=./makefileCommon +# PLATFORM_CFLAGS + +# PROJECT_CXX = include-what-you-use +# PROJECT_CC = include-what-you-use +# CXX = include-what-you-use +# CC = include-what-you-use # include the global configuration file include $(OF_SHARED_MAKEFILES_PATH)/config.shared.mk From 60a7ccc7a88972ef332761d2c22177b49798bec7 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Thu, 6 Oct 2022 16:27:58 -0300 Subject: [PATCH 2/6] undo Makefile changes --- libs/openFrameworksCompiled/project/Makefile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libs/openFrameworksCompiled/project/Makefile b/libs/openFrameworksCompiled/project/Makefile index c320bd0242a..0e53bc058c7 100644 --- a/libs/openFrameworksCompiled/project/Makefile +++ b/libs/openFrameworksCompiled/project/Makefile @@ -14,12 +14,6 @@ # define the OF_SHARED_MAKEFILES location OF_SHARED_MAKEFILES_PATH=./makefileCommon -# PLATFORM_CFLAGS - -# PROJECT_CXX = include-what-you-use -# PROJECT_CC = include-what-you-use -# CXX = include-what-you-use -# CC = include-what-you-use # include the global configuration file include $(OF_SHARED_MAKEFILES_PATH)/config.shared.mk From 0ae1d62051f6406606534196c2936f0054f9c7a9 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Thu, 6 Oct 2022 16:29:40 -0300 Subject: [PATCH 3/6] not mom really --- libs/openFrameworks/gl/ofFbo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/openFrameworks/gl/ofFbo.cpp b/libs/openFrameworks/gl/ofFbo.cpp index 177bff9e579..1804915ab84 100644 --- a/libs/openFrameworks/gl/ofFbo.cpp +++ b/libs/openFrameworks/gl/ofFbo.cpp @@ -303,10 +303,10 @@ ofFbo::ofFbo(const ofFbo & mom){ } //-------------------------------------------------------------- -void ofFbo::operator+=(const ofFbo & mom){ +void ofFbo::operator+=(const ofFbo & f){ this->begin(); ofSetColor(255); - mom.draw(0,0); + f.draw(0,0); this->end(); } From 0dfe7639c90214b2ef49811700709aa2bb7e66b5 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Thu, 6 Oct 2022 19:26:48 -0300 Subject: [PATCH 4/6] removing ofSetColor --- libs/openFrameworks/gl/ofFbo.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/openFrameworks/gl/ofFbo.cpp b/libs/openFrameworks/gl/ofFbo.cpp index 1804915ab84..a957c36afbe 100644 --- a/libs/openFrameworks/gl/ofFbo.cpp +++ b/libs/openFrameworks/gl/ofFbo.cpp @@ -305,7 +305,6 @@ ofFbo::ofFbo(const ofFbo & mom){ //-------------------------------------------------------------- void ofFbo::operator+=(const ofFbo & f){ this->begin(); - ofSetColor(255); f.draw(0,0); this->end(); } From ac8076affb6c408ea4828a29bc59f0ee58fdae7b Mon Sep 17 00:00:00 2001 From: Dimitre Date: Thu, 8 Dec 2022 16:00:53 -0300 Subject: [PATCH 5/6] fbo isAllocated check --- libs/openFrameworks/gl/ofFbo.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/openFrameworks/gl/ofFbo.cpp b/libs/openFrameworks/gl/ofFbo.cpp index a957c36afbe..0c57cd4cb55 100644 --- a/libs/openFrameworks/gl/ofFbo.cpp +++ b/libs/openFrameworks/gl/ofFbo.cpp @@ -304,9 +304,11 @@ ofFbo::ofFbo(const ofFbo & mom){ //-------------------------------------------------------------- void ofFbo::operator+=(const ofFbo & f){ - this->begin(); - f.draw(0,0); - this->end(); + if (f.isAllocated()) { + this->begin(); + f.draw(0,0); + this->end(); + } } //-------------------------------------------------------------- From 8eeff2d5e60f313082f2036a24c24ef3ef2bdfae Mon Sep 17 00:00:00 2001 From: Dimitre Date: Thu, 8 Dec 2022 16:02:00 -0300 Subject: [PATCH 6/6] consistent args --- libs/openFrameworks/gl/ofFbo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/openFrameworks/gl/ofFbo.cpp b/libs/openFrameworks/gl/ofFbo.cpp index 0c57cd4cb55..32632850f86 100644 --- a/libs/openFrameworks/gl/ofFbo.cpp +++ b/libs/openFrameworks/gl/ofFbo.cpp @@ -303,10 +303,10 @@ ofFbo::ofFbo(const ofFbo & mom){ } //-------------------------------------------------------------- -void ofFbo::operator+=(const ofFbo & f){ - if (f.isAllocated()) { +void ofFbo::operator+=(const ofFbo & fbo){ + if (fbo.isAllocated()) { this->begin(); - f.draw(0,0); + fbo.draw(0,0); this->end(); } }