Avoid taking lock when not necessary

This commit is contained in:
Chris Thrasher 2023-09-01 20:39:34 -06:00
parent 48071ed335
commit 7c9e7aa31a

View File

@ -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<unsigned int>(samples);
#endif
return static_cast<unsigned int>(samples);
}