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.
This commit is contained in:
L'électron rare
2026-05-18 17:19:25 +02:00
parent fddb31e3ee
commit 4cca03db9f
+6 -1
View File
@@ -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<float>& magCh1,