sdlDateTimeToTime function time

bool sdlDateTimeToTime(
  1. Pointer<SdlDateTime> dt,
  2. Pointer<Int64> ticks
)

Converts a calendar time to an SDL_Time in nanoseconds since the epoch.

This function ignores the day_of_week member of the SDL_DateTime struct, so it may remain unset.

\param dt the source SDL_DateTime. \param ticks the resulting SDL_Time. \returns true on success or false on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.2.0.

extern SDL_DECLSPEC bool SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks)

Implementation

bool sdlDateTimeToTime(Pointer<SdlDateTime> dt, Pointer<Int64> ticks) {
  final sdlDateTimeToTimeLookupFunction = _libSdl
      .lookupFunction<
        Uint8 Function(Pointer<SdlDateTime> dt, Pointer<Int64> ticks),
        int Function(Pointer<SdlDateTime> dt, Pointer<Int64> ticks)
      >('SDL_DateTimeToTime');
  return sdlDateTimeToTimeLookupFunction(dt, ticks) == 1;
}