sdlCreateEnvironment function

Pointer<SdlEnvironment> sdlCreateEnvironment(
  1. bool populated
)

Create a set of environment variables

\param populated true to initialize it from the C runtime environment, false to create an empty environment. \returns a pointer to the new environment or NULL on failure; call SDL_GetError() for more information.

\threadsafety If populated is false, it is safe to call this function from any thread, otherwise it is safe if no other threads are calling setenv() or unsetenv()

\since This function is available since SDL 3.1.3.

\sa SDL_GetEnvironmentVariable \sa SDL_GetEnvironmentVariables \sa SDL_SetEnvironmentVariable \sa SDL_UnsetEnvironmentVariable \sa SDL_DestroyEnvironment

extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_CreateEnvironment(bool populated)

Implementation

Pointer<SdlEnvironment> sdlCreateEnvironment(bool populated) {
  final sdlCreateEnvironmentLookupFunction = libSdl3.lookupFunction<
      Pointer<SdlEnvironment> Function(Uint8 populated),
      Pointer<SdlEnvironment> Function(int populated)>('SDL_CreateEnvironment');
  return sdlCreateEnvironmentLookupFunction(populated ? 1 : 0);
}