From 7c9e7aa31ad13284eb31186e340de508b3cf2e9b Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Fri, 1 Sep 2023 20:39:34 -0600 Subject: [PATCH] Avoid taking lock when not necessary --- src/SFML/Graphics/RenderTextureImplFBO.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/SFML/Graphics/RenderTextureImplFBO.cpp b/src/SFML/Graphics/RenderTextureImplFBO.cpp index 804a1b3d2..5dc03b214 100644 --- a/src/SFML/Graphics/RenderTextureImplFBO.cpp +++ b/src/SFML/Graphics/RenderTextureImplFBO.cpp @@ -116,17 +116,18 @@ bool RenderTextureImplFBO::isAvailable() //////////////////////////////////////////////////////////// unsigned int RenderTextureImplFBO::getMaximumAntialiasingLevel() { +#ifdef SFML_OPENGL_ES + + return 0; + +#else + const TransientContextLock lock; - - GLint samples = 0; // NOLINT(misc-const-correctness) - -#ifndef SFML_OPENGL_ES - + GLint samples = 0; glCheck(glGetIntegerv(GLEXT_GL_MAX_SAMPLES, &samples)); + return static_cast(samples); #endif - - return static_cast(samples); }