From 4cca03db9f61d037051c6ae9877d4a093e544533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=27=C3=A9lectron=20rare?= <108685187+electron-rare@users.noreply.github.com> Date: Mon, 18 May 2026 17:19:25 +0200 Subject: [PATCH] fix: log sphere shader load failure ofShader::load returned bool was discarded, so a failed shader load rendered black with no diagnostic. Log an error on failure and document the global ofDisableArbTex state change. --- oscope-sphere/src/SphereViz.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oscope-sphere/src/SphereViz.cpp b/oscope-sphere/src/SphereViz.cpp index 20326b5..c459507 100644 --- a/oscope-sphere/src/SphereViz.cpp +++ b/oscope-sphere/src/SphereViz.cpp @@ -12,6 +12,10 @@ void SphereViz::setup(int icoIterations, int spectroWidth, int spectroHeight) { mesh_.addNormals(src.getNormals()); mesh_.addIndices(src.getIndices()); + // ofDisableArbTex() is a global, app-wide GL state change: it makes all + // textures use normalized [0,1] coordinates. oscope-sphere has a single + // SphereViz so this is safe; revisit if other ARB-texture components are + // ever added. ofDisableArbTex(); spectroPix_.allocate(spectroWidth, spectroHeight, OF_PIXELS_GRAY); spectroPix_.set(0.0f); @@ -19,7 +23,8 @@ void SphereViz::setup(int icoIterations, int spectroWidth, int spectroHeight) { spectroTex_.setTextureWrap(GL_REPEAT, GL_CLAMP_TO_EDGE); spectroTex_.setTextureMinMagFilter(GL_LINEAR, GL_LINEAR); - shader_.load("shaders/sphere"); + if (!shader_.load("shaders/sphere")) + ofLogError("SphereViz") << "failed to load shaders/sphere"; } void SphereViz::pushSpectrogramColumn(const std::vector& magCh1,