Skip to content

Commit

Permalink
fix: ensure extensions init
Browse files Browse the repository at this point in the history
  • Loading branch information
Scorbutics committed Jun 20, 2024
1 parent 21f4e44 commit 8198317
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/SFML/Graphics/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,21 +785,17 @@ bool Shader::isAvailable()

TransientContextLock contextLock;

#ifdef SFML_OPENGL_ES

available = true;

#else

// Make sure that extensions are initialized
sf::priv::ensureExtensionsInit();

#ifdef SFML_OPENGL_ES
available = true;
#else
available = GLEXT_multitexture &&
GLEXT_shading_language_100 &&
GLEXT_shader_objects &&
GLEXT_vertex_shader &&
GLEXT_fragment_shader;

#endif

}
Expand All @@ -822,17 +818,13 @@ bool Shader::isGeometryAvailable()

TransientContextLock contextLock;

#ifdef SFML_OPENGL_ES

available = false;

#else

// Make sure that extensions are initialized
sf::priv::ensureExtensionsInit();

#ifdef SFML_OPENGL_ES
available = false;
#else
available = isAvailable() && (GLEXT_geometry_shader4 || GLEXT_GL_VERSION_3_2);

#endif

}
Expand Down

0 comments on commit 8198317

Please sign in to comment.