Function SDL_GL_ExtensionSupported

pub unsafe extern "C" fn SDL_GL_ExtensionSupported(
    extension: *const i8,
) -> bool
Available on crate feature dep_sdl3 only.
Expand description

Check if an OpenGL extension is supported for the current context.

This function operates on the current GL context; you must have created a context and it must be current before calling this function. Do not assume that all contexts you create will have the same set of extensions available, or that recreating an existing context will offer the same extensions again.

While it’s probably not a massive overhead, this function is not an O(1) operation. Check the extensions you care about after creating the GL context and save that information somewhere instead of calling the function every time you need to know.

§Parameters

  • extension: the name of the extension to check.

§Return value

Returns true if the extension is supported, false otherwise.

§Thread safety

This function should only be called on the main thread.

§Availability

This function is available since SDL 3.2.0.