From e9db9cebff8a8659ab422b2356fee9a81da15db3 Mon Sep 17 00:00:00 2001 From: Seb James Date: Wed, 3 Jun 2026 10:27:50 +0100 Subject: [PATCH] Call PolygonMode only if we are NOT in GL ES mode --- mplot/VisualModel.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/mplot/VisualModel.h b/mplot/VisualModel.h index e2f8d55a..e10f68a4 100644 --- a/mplot/VisualModel.h +++ b/mplot/VisualModel.h @@ -300,11 +300,14 @@ namespace mplot if (!this->indices.empty()) { - // Enable/disable wireframe mode per-model on each render call - if (this->flags.test (vm_bools::wireframe)) { - _glfn->PolygonMode (GL_FRONT_AND_BACK, GL_LINE); - } else { - _glfn->PolygonMode (GL_FRONT_AND_BACK, GL_FILL); + // glPolygonMode is OpenGL only and not support on GL ES + if constexpr (mplot::gl::version::gles (glver) == false) { + // Enable/disable wireframe mode per-model on each render call + if (this->flags.test (vm_bools::wireframe)) { + _glfn->PolygonMode (GL_FRONT_AND_BACK, GL_LINE); + } else { + _glfn->PolygonMode (GL_FRONT_AND_BACK, GL_FILL); + } } // It is only necessary to bind the vertex array object before rendering @@ -360,7 +363,9 @@ namespace mplot mplot::gl::Util::checkError (__FILE__, __LINE__, _glfn); // Now render any VisualTextModels - _glfn->PolygonMode (GL_FRONT_AND_BACK, GL_FILL); + if constexpr (mplot::gl::version::gles (glver) == false) { + _glfn->PolygonMode (GL_FRONT_AND_BACK, GL_FILL); + } auto ti = this->texts.begin(); while (ti != this->texts.end()) { (*ti)->render(); ti++; }