From b199d12b7e7d58e68b5e0915df92d3336f37b7b6 Mon Sep 17 00:00:00 2001 From: NickHardeman Date: Fri, 4 Sep 2026 12:33:19 -0400 Subject: [PATCH 1/9] Remove GL specific code from ofBackgroundGradient and point sprites. --- libs/openFrameworks/graphics/ofGraphics.cpp | 73 ++------------------- 1 file changed, 5 insertions(+), 68 deletions(-) diff --git a/libs/openFrameworks/graphics/ofGraphics.cpp b/libs/openFrameworks/graphics/ofGraphics.cpp index b7e45922cd5..1e2dd151c07 100644 --- a/libs/openFrameworks/graphics/ofGraphics.cpp +++ b/libs/openFrameworks/graphics/ofGraphics.cpp @@ -1,4 +1,4 @@ -#include "ofGLRenderer.h" +//#include "ofGLRenderer.h" #include "ofGraphics.h" #include "ofRendererCollection.h" #include "ofRectangle.h" @@ -11,7 +11,7 @@ using std::shared_ptr; using std::string; using std::vector; -static ofVboMesh gradientMesh; +//static ofVboMesh gradientMesh; void ofSetCurrentRenderer(shared_ptr renderer, bool setDefaults) { if (setDefaults) { @@ -409,66 +409,7 @@ void ofBackgroundHex(int hexColor, int alpha){ //---------------------------------------------------------- void ofBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) { - float w = ofGetViewportWidth(), h = ofGetViewportHeight(); - gradientMesh.clear(); - gradientMesh.setMode(OF_PRIMITIVE_TRIANGLE_FAN); -#ifndef TARGET_EMSCRIPTEN - #ifdef TARGET_OPENGLES - if (ofIsGLProgrammableRenderer()) gradientMesh.setUsage(GL_STREAM_DRAW); - #else - gradientMesh.setUsage(GL_STREAM_DRAW); - #endif -#endif - if (mode == OF_GRADIENT_CIRCULAR) { - // this could be optimized by building a single mesh once, then copying - // it and just adding the colors whenever the function is called. - ///TODO: revert to glm::vec2!! - glm::vec2 center(w / 2, h / 2); - gradientMesh.addVertex(glm::vec3(center, 0.f)); - gradientMesh.addColor(start); - float n = 32; // circular gradient resolution - float angleBisector = glm::two_pi() / (n * 2.0); - float smallRadius = ofDist(0, 0, w / 2, h / 2); - float bigRadius = smallRadius / std::cos(angleBisector); - for (int i = 0; i <= n; i++) { - float theta = i * glm::two_pi() / n; - gradientMesh.addVertex(glm::vec3(center + glm::vec2(std::sin(theta), std::cos(theta)) * bigRadius, 0)); - gradientMesh.addColor(end); - } - } else if (mode == OF_GRADIENT_LINEAR) { - gradientMesh.addVertex({ 0.f, 0.f, 0.f }); - gradientMesh.addVertex({ w, 0.f, 0.f }); - gradientMesh.addVertex({ w, h, 0.f }); - gradientMesh.addVertex({ 0.f, h, 0.f }); - gradientMesh.addColor(start); - gradientMesh.addColor(start); - gradientMesh.addColor(end); - gradientMesh.addColor(end); - } else if (mode == OF_GRADIENT_BAR) { - gradientMesh.addVertex({ w / 2.f, h / 2.f, 0.f }); - gradientMesh.addVertex({ 0.f, h / 2.f, 0.f }); - gradientMesh.addVertex({ 0.f, 0.f, 0.f }); - gradientMesh.addVertex({ w, 0.f, 0.f }); - gradientMesh.addVertex({ w, h / 2.f, 0.f }); - gradientMesh.addVertex({ w, h, 0.f }); - gradientMesh.addVertex({ 0.f, h, 0.f }); - gradientMesh.addVertex({ 0.f, h / 2, 0.f }); - gradientMesh.addColor(start); - gradientMesh.addColor(start); - gradientMesh.addColor(end); - gradientMesh.addColor(end); - gradientMesh.addColor(start); - gradientMesh.addColor(end); - gradientMesh.addColor(end); - gradientMesh.addColor(start); - } - GLboolean depthMaskEnabled; - glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMaskEnabled); - glDepthMask(GL_FALSE); - gradientMesh.draw(); - if (depthMaskEnabled) { - glDepthMask(GL_TRUE); - } + ofGetCurrentRenderer()->drawBackgroundGradient(start, end, mode); } //---------------------------------------------------------- @@ -638,16 +579,12 @@ void ofEnableBlendMode(ofBlendMode blendMode){ //---------------------------------------------------------- void ofEnablePointSprites() { - if (ofGetCurrentRenderer()->getType() == "GL" || ofGetCurrentRenderer()->getType() == "ProgrammableGL") { - static_cast(ofGetCurrentRenderer().get())->enablePointSprites(); - } + ofGetCurrentRenderer()->enablePointSprites(); } //---------------------------------------------------------- void ofDisablePointSprites() { - if (ofGetCurrentRenderer()->getType() == "GL" || ofGetCurrentRenderer()->getType() == "ProgrammableGL") { - static_cast(ofGetCurrentRenderer().get())->disablePointSprites(); - } + ofGetCurrentRenderer()->disablePointSprites(); } //---------------------------------------------------------- From ce356e9b19ced1c9ac4db613334ab1fc2ec1ccd5 Mon Sep 17 00:00:00 2001 From: NickHardeman Date: Fri, 4 Sep 2026 12:34:43 -0400 Subject: [PATCH 2/9] add enablePointSprites(), disablePointSprites() and drawBackgroundGradient() --- .../graphics/ofGraphicsBaseTypes.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libs/openFrameworks/graphics/ofGraphicsBaseTypes.h b/libs/openFrameworks/graphics/ofGraphicsBaseTypes.h index 0ed0e7c77cd..410cca90188 100644 --- a/libs/openFrameworks/graphics/ofGraphicsBaseTypes.h +++ b/libs/openFrameworks/graphics/ofGraphicsBaseTypes.h @@ -861,6 +861,10 @@ class ofBaseRenderer { /// /// \param pointSize The points size to request this renderer to use. virtual void setPointSize(float pointSize) = 0; + /// \brief Enable point sprites via a shader. + virtual void enablePointSprites() = 0; + /// \brief Disable point sprites via a shader. + virtual void disablePointSprites() = 0; /// \brief Enable/disable depth testing with this renderer. /// @@ -1137,6 +1141,18 @@ class ofBaseRenderer { /// \param x The x position for the bottom of \p text. /// \param y The y position for the left alignment of \p text. virtual void drawString(const ofTrueTypeFont & font, std::string text, float x, float y) const = 0; + + /// \brief Sets the background color to a gradient. + /// + /// It takes as input 2 ofColor() objects and a Gradient Mode. + /// Must be called in the draw() function. + /// + /// Accepted modes are: + /// + /// - Circular: `OF_GRADIENT_CIRCULAR` + /// - Linear: `OF_GRADIENT_LINEAR` + /// - Bar: `OF_GRADIENT_BAR` + virtual void drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const = 0; // returns true an ofPath to draw with, this allows to keep // immediate mode rendering working in multiwindow with multiple From cdb43d58357db50ae9870eb550b5f07328ac1310 Mon Sep 17 00:00:00 2001 From: NickHardeman Date: Fri, 4 Sep 2026 12:35:39 -0400 Subject: [PATCH 3/9] add drawBackgroundGradient(), enablePointSprites and disablePointSprites() --- libs/openFrameworks/graphics/ofCairoRenderer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/openFrameworks/graphics/ofCairoRenderer.h b/libs/openFrameworks/graphics/ofCairoRenderer.h index fa212d63d5a..41f076f4dfc 100644 --- a/libs/openFrameworks/graphics/ofCairoRenderer.h +++ b/libs/openFrameworks/graphics/ofCairoRenderer.h @@ -46,6 +46,8 @@ class ofCairoRenderer: public ofBaseRenderer{ void draw(const ofFloatImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const; void draw(const ofShortImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const; void draw(const ofBaseVideoDraws & video, float x, float y, float w, float h) const; + // TODO: This could probably be implemented. + void drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const {}; ofPath & getPath(); //-------------------------------------------- @@ -85,6 +87,8 @@ class ofCairoRenderer: public ofBaseRenderer{ ofFillFlag getFillMode(); void setLineWidth(float lineWidth); void setPointSize(float pointSize); + void enablePointSprites() {}; + void disablePointSprites() {}; void setDepthTest(bool depthTest); void setBlendMode(ofBlendMode blendMode); void setLineSmoothing(bool smooth); From 7b0bca7a05f7a6cabaec38ddc3c653c87fa6baac Mon Sep 17 00:00:00 2001 From: NickHardeman Date: Fri, 4 Sep 2026 12:36:12 -0400 Subject: [PATCH 4/9] remove dependency on ofVboMesh from ofPath.h --- libs/openFrameworks/graphics/ofPath.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/openFrameworks/graphics/ofPath.h b/libs/openFrameworks/graphics/ofPath.h index e206b1c981d..c374005c077 100644 --- a/libs/openFrameworks/graphics/ofPath.h +++ b/libs/openFrameworks/graphics/ofPath.h @@ -1,7 +1,8 @@ #pragma once #include "ofPolyline.h" -#include "ofVboMesh.h" +//#include "ofVboMesh.h" +#include "ofMesh.h" #include "ofTessellator.h" // MARK: ofConstants targets #include "ofConstants.h" @@ -432,11 +433,11 @@ class ofPath{ std::vector polylines; std::vector tessellatedContour; // if winding mode != ODD -#ifdef TARGET_OPENGLES +//#ifdef TARGET_OPENGLES ofMesh cachedTessellation; -#else - ofVboMesh cachedTessellation; -#endif +//#else +// ofVboMesh cachedTessellation; +//#endif #if defined(TARGET_EMSCRIPTEN) static ofTessellator tessellator; #elif HAS_TLS From 8569c77c668b8499bdba88649506fdb33e9626c0 Mon Sep 17 00:00:00 2001 From: NickHardeman Date: Fri, 4 Sep 2026 12:40:35 -0400 Subject: [PATCH 5/9] add drawBackgroundGradient(), enablePointSprites and disablePointSprites() --- .../graphics/ofRendererCollection.cpp | 14 ++++++++------ .../openFrameworks/graphics/ofRendererCollection.h | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libs/openFrameworks/graphics/ofRendererCollection.cpp b/libs/openFrameworks/graphics/ofRendererCollection.cpp index eb7b8613867..1b807d04434 100644 --- a/libs/openFrameworks/graphics/ofRendererCollection.cpp +++ b/libs/openFrameworks/graphics/ofRendererCollection.cpp @@ -91,6 +91,12 @@ void ofRendererCollection::draw(const ofBaseVideoDraws & video, float x, float y } } +void ofRendererCollection::drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const { + for(auto renderer: renderers){ + renderer->drawBackgroundGradient(start, end, mode); + } +} + /*void bind(const ofBaseVideoDraws & video) const{ for(int i=0;i<(int)renderers.size();i++){ renderers[i]->bind(video); @@ -573,16 +579,12 @@ void ofRendererCollection::setCircleResolution(int res){ } void ofRendererCollection::enablePointSprites(){ for(auto renderer: renderers){ - if(renderer->getType()=="GL" || renderer->getType()=="ProgrammableGL"){ - std::dynamic_pointer_cast(renderer)->enablePointSprites(); - } + renderer->enablePointSprites(); } } void ofRendererCollection::disablePointSprites(){ for(auto renderer: renderers){ - if(renderer->getType()=="GL" || renderer->getType()=="ProgrammableGL"){ - std::dynamic_pointer_cast(renderer)->disablePointSprites(); - } + renderer->disablePointSprites(); } } diff --git a/libs/openFrameworks/graphics/ofRendererCollection.h b/libs/openFrameworks/graphics/ofRendererCollection.h index c3bf3937d1e..f5aca01ada5 100644 --- a/libs/openFrameworks/graphics/ofRendererCollection.h +++ b/libs/openFrameworks/graphics/ofRendererCollection.h @@ -39,6 +39,8 @@ class ofRendererCollection: public ofBaseRenderer{ void draw(const ofShortImage & img, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const; void draw(const ofBaseVideoDraws & video, float x, float y, float w, float h) const; + + void drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const; /*void bind(const ofBaseVideoDraws & video) const{ for(int i=0;i<(int)renderers.size();i++){ From 7ff4b72f5b4ab36db7c0602581a8a9348d36d720 Mon Sep 17 00:00:00 2001 From: NickHardeman Date: Fri, 4 Sep 2026 12:42:57 -0400 Subject: [PATCH 6/9] add drawBackgroundGradient to ofNoopRenderer. --- libs/openFrameworks/app/ofAppNoWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/openFrameworks/app/ofAppNoWindow.cpp b/libs/openFrameworks/app/ofAppNoWindow.cpp index b8632a343ea..c1de76d323e 100644 --- a/libs/openFrameworks/app/ofAppNoWindow.cpp +++ b/libs/openFrameworks/app/ofAppNoWindow.cpp @@ -86,6 +86,7 @@ class ofNoopRenderer: public ofBaseRenderer{ void draw(const ofFloatImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const{} void draw(const ofShortImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const{} void draw(const ofBaseVideoDraws & video, float x, float y, float w, float h) const{} + void drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const {}; //-------------------------------------------- // transformations From 5de5072eab7abe63af5026b06a5b40a07a8a6328 Mon Sep 17 00:00:00 2001 From: NickHardeman Date: Fri, 4 Sep 2026 12:46:45 -0400 Subject: [PATCH 7/9] include ofVboMesh in cube map --- libs/openFrameworks/gl/ofCubeMap.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/openFrameworks/gl/ofCubeMap.cpp b/libs/openFrameworks/gl/ofCubeMap.cpp index 5d5471bee73..2537c99e035 100644 --- a/libs/openFrameworks/gl/ofCubeMap.cpp +++ b/libs/openFrameworks/gl/ofCubeMap.cpp @@ -10,6 +10,7 @@ #include "ofTexture.h" #include "ofFileUtils.h" #include "ofMaterial.h" +#include "ofVboMesh.h" #ifdef TARGET_ANDROID #include "ofAppAndroidWindow.h" From d114d8a85be3d073a3b8b8975a236933c85da732 Mon Sep 17 00:00:00 2001 From: NickHardeman Date: Fri, 4 Sep 2026 12:52:56 -0400 Subject: [PATCH 8/9] add drawBackgroundGradient to GL renderers. --- .../gl/ofGLProgrammableRenderer.cpp | 62 +++++++++++++++++++ .../gl/ofGLProgrammableRenderer.h | 3 + libs/openFrameworks/gl/ofGLRenderer.cpp | 62 +++++++++++++++++++ libs/openFrameworks/gl/ofGLRenderer.h | 1 + 4 files changed, 128 insertions(+) diff --git a/libs/openFrameworks/gl/ofGLProgrammableRenderer.cpp b/libs/openFrameworks/gl/ofGLProgrammableRenderer.cpp index 91e86fc46de..f14f79bdcb3 100644 --- a/libs/openFrameworks/gl/ofGLProgrammableRenderer.cpp +++ b/libs/openFrameworks/gl/ofGLProgrammableRenderer.cpp @@ -37,6 +37,8 @@ bool ofIsGLProgrammableRenderer() { return programmableRendererCreated; } +static ofVboMesh gradientMesh; + //---------------------------------------------------------- ofGLProgrammableRenderer::ofGLProgrammableRenderer(const ofAppBaseWindow * _window) : matrixStack(_window) @@ -619,6 +621,66 @@ void ofGLProgrammableRenderer::drawElementsInstanced(const ofVbo & vbo, GLuint d } } +//---------------------------------------------------------- +void ofGLProgrammableRenderer::drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const { + float w = getViewportWidth(), h = getViewportHeight(); + gradientMesh.clear(); + gradientMesh.setMode(OF_PRIMITIVE_TRIANGLE_FAN); +#ifndef TARGET_EMSCRIPTEN + gradientMesh.setUsage(GL_STREAM_DRAW); +#endif + if (mode == OF_GRADIENT_CIRCULAR) { + // this could be optimized by building a single mesh once, then copying + // it and just adding the colors whenever the function is called. + ///TODO: revert to glm::vec2!! + glm::vec2 center(w / 2, h / 2); + gradientMesh.addVertex(glm::vec3(center, 0.f)); + gradientMesh.addColor(start); + float n = 32; // circular gradient resolution + float angleBisector = glm::two_pi() / (n * 2.0); + float smallRadius = ofDist(0, 0, w / 2, h / 2); + float bigRadius = smallRadius / std::cos(angleBisector); + for (int i = 0; i <= n; i++) { + float theta = i * glm::two_pi() / n; + gradientMesh.addVertex(glm::vec3(center + glm::vec2(std::sin(theta), std::cos(theta)) * bigRadius, 0)); + gradientMesh.addColor(end); + } + } else if (mode == OF_GRADIENT_LINEAR) { + gradientMesh.addVertex({ 0.f, 0.f, 0.f }); + gradientMesh.addVertex({ w, 0.f, 0.f }); + gradientMesh.addVertex({ w, h, 0.f }); + gradientMesh.addVertex({ 0.f, h, 0.f }); + gradientMesh.addColor(start); + gradientMesh.addColor(start); + gradientMesh.addColor(end); + gradientMesh.addColor(end); + } else if (mode == OF_GRADIENT_BAR) { + gradientMesh.addVertex({ w / 2.f, h / 2.f, 0.f }); + gradientMesh.addVertex({ 0.f, h / 2.f, 0.f }); + gradientMesh.addVertex({ 0.f, 0.f, 0.f }); + gradientMesh.addVertex({ w, 0.f, 0.f }); + gradientMesh.addVertex({ w, h / 2.f, 0.f }); + gradientMesh.addVertex({ w, h, 0.f }); + gradientMesh.addVertex({ 0.f, h, 0.f }); + gradientMesh.addVertex({ 0.f, h / 2, 0.f }); + gradientMesh.addColor(start); + gradientMesh.addColor(start); + gradientMesh.addColor(end); + gradientMesh.addColor(end); + gradientMesh.addColor(start); + gradientMesh.addColor(end); + gradientMesh.addColor(end); + gradientMesh.addColor(start); + } + GLboolean depthMaskEnabled; + glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMaskEnabled); + glDepthMask(GL_FALSE); + gradientMesh.draw(); + if (depthMaskEnabled) { + glDepthMask(GL_TRUE); + } +} + //---------------------------------------------------------- ofPath & ofGLProgrammableRenderer::getPath() { return path; diff --git a/libs/openFrameworks/gl/ofGLProgrammableRenderer.h b/libs/openFrameworks/gl/ofGLProgrammableRenderer.h index 4adac96f4ba..2c2683f1bcc 100644 --- a/libs/openFrameworks/gl/ofGLProgrammableRenderer.h +++ b/libs/openFrameworks/gl/ofGLProgrammableRenderer.h @@ -8,6 +8,7 @@ #include "ofPolyline.h" #include "ofBitmapFont.h" #include "ofPath.h" +#include "ofVbo.h" class ofShapeTessellation; class ofFbo; @@ -44,6 +45,8 @@ class ofGLProgrammableRenderer: public ofBaseGLRenderer{ void drawElementsInstanced(const ofVbo & vbo, GLuint drawMode, int amt, int primCount) const; void draw(const ofVboMesh & mesh, ofPolyRenderMode renderType) const; void drawInstanced(const ofVboMesh & mesh, ofPolyRenderMode renderType, int primCount) const; + void drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const; + ofPath & getPath(); diff --git a/libs/openFrameworks/gl/ofGLRenderer.cpp b/libs/openFrameworks/gl/ofGLRenderer.cpp index 2e729bae896..525b19f25f2 100644 --- a/libs/openFrameworks/gl/ofGLRenderer.cpp +++ b/libs/openFrameworks/gl/ofGLRenderer.cpp @@ -20,6 +20,8 @@ using std::vector; const std::string ofGLRenderer::TYPE = "GL"; +static ofVboMesh gradientMesh; + //---------------------------------------------------------- ofGLRenderer::ofGLRenderer(const ofAppBaseWindow * _window) : matrixStack(_window) @@ -432,6 +434,66 @@ void ofGLRenderer::drawElementsInstanced(const ofVbo & vbo, GLuint drawMode, int } } +//---------------------------------------------------------- +void ofGLRenderer::drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const { + float w = getViewportWidth(), h = getViewportHeight(); + gradientMesh.clear(); + gradientMesh.setMode(OF_PRIMITIVE_TRIANGLE_FAN); +#ifndef TARGET_EMSCRIPTEN + gradientMesh.setUsage(GL_STREAM_DRAW); +#endif + if (mode == OF_GRADIENT_CIRCULAR) { + // this could be optimized by building a single mesh once, then copying + // it and just adding the colors whenever the function is called. + ///TODO: revert to glm::vec2!! + glm::vec2 center(w / 2, h / 2); + gradientMesh.addVertex(glm::vec3(center, 0.f)); + gradientMesh.addColor(start); + float n = 32; // circular gradient resolution + float angleBisector = glm::two_pi() / (n * 2.0); + float smallRadius = ofDist(0, 0, w / 2, h / 2); + float bigRadius = smallRadius / std::cos(angleBisector); + for (int i = 0; i <= n; i++) { + float theta = i * glm::two_pi() / n; + gradientMesh.addVertex(glm::vec3(center + glm::vec2(std::sin(theta), std::cos(theta)) * bigRadius, 0)); + gradientMesh.addColor(end); + } + } else if (mode == OF_GRADIENT_LINEAR) { + gradientMesh.addVertex({ 0.f, 0.f, 0.f }); + gradientMesh.addVertex({ w, 0.f, 0.f }); + gradientMesh.addVertex({ w, h, 0.f }); + gradientMesh.addVertex({ 0.f, h, 0.f }); + gradientMesh.addColor(start); + gradientMesh.addColor(start); + gradientMesh.addColor(end); + gradientMesh.addColor(end); + } else if (mode == OF_GRADIENT_BAR) { + gradientMesh.addVertex({ w / 2.f, h / 2.f, 0.f }); + gradientMesh.addVertex({ 0.f, h / 2.f, 0.f }); + gradientMesh.addVertex({ 0.f, 0.f, 0.f }); + gradientMesh.addVertex({ w, 0.f, 0.f }); + gradientMesh.addVertex({ w, h / 2.f, 0.f }); + gradientMesh.addVertex({ w, h, 0.f }); + gradientMesh.addVertex({ 0.f, h, 0.f }); + gradientMesh.addVertex({ 0.f, h / 2, 0.f }); + gradientMesh.addColor(start); + gradientMesh.addColor(start); + gradientMesh.addColor(end); + gradientMesh.addColor(end); + gradientMesh.addColor(start); + gradientMesh.addColor(end); + gradientMesh.addColor(end); + gradientMesh.addColor(start); + } + GLboolean depthMaskEnabled; + glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMaskEnabled); + glDepthMask(GL_FALSE); + gradientMesh.draw(); + if (depthMaskEnabled) { + glDepthMask(GL_TRUE); + } +} + //---------------------------------------------------------- ofPath & ofGLRenderer::getPath() { return path; diff --git a/libs/openFrameworks/gl/ofGLRenderer.h b/libs/openFrameworks/gl/ofGLRenderer.h index 9371c516376..59eaaf70d2c 100644 --- a/libs/openFrameworks/gl/ofGLRenderer.h +++ b/libs/openFrameworks/gl/ofGLRenderer.h @@ -43,6 +43,7 @@ class ofGLRenderer: public ofBaseGLRenderer{ void drawElementsInstanced(const ofVbo & vbo, GLuint drawMode, int amt, int primCount) const; void draw(const ofVboMesh & mesh, ofPolyRenderMode renderType) const; void drawInstanced(const ofVboMesh & mesh, ofPolyRenderMode renderType, int primCount) const; + void drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const; ofPath & getPath(); From e8c94437954fd286bb64f20e44c3dcf780f5a518 Mon Sep 17 00:00:00 2001 From: NickHardeman Date: Fri, 4 Sep 2026 13:48:21 -0400 Subject: [PATCH 9/9] include ofVboMesh.h --- addons/ofxGui/src/ofxToggle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/ofxGui/src/ofxToggle.h b/addons/ofxGui/src/ofxToggle.h index 6332f8ebfd6..481525ba243 100644 --- a/addons/ofxGui/src/ofxToggle.h +++ b/addons/ofxGui/src/ofxToggle.h @@ -1,8 +1,8 @@ #pragma once - #include "ofParameter.h" #include "ofxBaseGui.h" #include "ofPath.h" +#include "ofVboMesh.h" class ofxToggle : public ofxBaseGui{ public: