sdlEglGetProcAddress function

Pointer<NativeType> sdlEglGetProcAddress(
  1. String? proc
)

Get an EGL library function by name.

If an EGL library is loaded, this function allows applications to get entry points for EGL functions. This is useful to provide to an EGL API and extension loader.

\param proc the name of an EGL function. \returns a pointer to the named EGL function. The returned pointer should be cast to the appropriate function signature.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.1.3.

\sa SDL_EGL_GetCurrentDisplay

extern SDL_DECLSPEC SDL_FunctionPointer SDLCALL SDL_EGL_GetProcAddress(const char *proc)

Implementation

Pointer<NativeType> sdlEglGetProcAddress(String? proc) {
  final sdlEglGetProcAddressLookupFunction = libSdl3.lookupFunction<
      Pointer<NativeType> Function(Pointer<Utf8> proc),
      Pointer<NativeType> Function(
          Pointer<Utf8> proc)>('SDL_EGL_GetProcAddress');
  final procPointer = proc != null ? proc.toNativeUtf8() : nullptr;
  final result = sdlEglGetProcAddressLookupFunction(procPointer);
  calloc.free(procPointer);
  return result;
}