sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys.Bindgen.Time.FunPtr

Synopsis

Documentation

sDL_GetDateTimeLocalePreferences :: FunPtr (Ptr SDL_DateFormat -> Ptr SDL_TimeFormat -> IO CBool) Source #

Gets the current preferred date and time format for the system locale.

This might be a "slow" call that has to query the operating system. It's best to ask for this once and save the results. However, the preferred formats can change, usually because the user has changed a system preference outside of your program.

dateFormat
a pointer to the SDL_DateFormat to hold the returned date format, may be NULL.
timeFormat
a pointer to the SDL_TimeFormat to hold the returned time format, may be NULL.
Returns
true on success or false on failure; call SDL_GetError() for more information.
Thread safety
This function is not thread safe.
C declaration
SDL_GetDateTimeLocalePreferences, defined at SDL3/SDL_time.h 113:34

Since: 3.2.0

sDL_GetCurrentTime :: FunPtr (Ptr SDL_Time -> IO CBool) Source #

Gets the current value of the system realtime clock in nanoseconds since Jan 1, 1970 in Universal Coordinated Time (UTC).

ticks
the SDL_Time to hold the returned tick count.
Returns
true on success or false on failure; call SDL_GetError() for more information.
Thread safety
It is safe to call this function from any thread.
C declaration
SDL_GetCurrentTime, defined at SDL3/SDL_time.h 127:34

Since: 3.2.0

sDL_TimeToDateTime :: FunPtr (SDL_Time -> Ptr SDL_DateTime -> CBool -> IO CBool) Source #

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

ticks
the SDL_Time to be converted.
dt
the resulting SDL_DateTime.
localTime
the resulting SDL_DateTime will be expressed in local time if true, otherwise it will be in Universal Coordinated Time (UTC).
Returns
true on success or false on failure; call SDL_GetError() for more information.
Thread safety
It is safe to call this function from any thread.
C declaration
SDL_TimeToDateTime, defined at SDL3/SDL_time.h 145:34

Since: 3.2.0

sDL_DateTimeToTime :: FunPtr (PtrConst SDL_DateTime -> Ptr SDL_Time -> IO CBool) Source #

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.

dt
the source SDL_DateTime.
ticks
the resulting SDL_Time.
Returns
true on success or false on failure; call SDL_GetError() for more information.
Thread safety
It is safe to call this function from any thread.
C declaration
SDL_DateTimeToTime, defined at SDL3/SDL_time.h 162:34

Since: 3.2.0

sDL_TimeToWindows :: FunPtr (SDL_Time -> Ptr Uint32 -> Ptr Uint32 -> IO ()) Source #

Converts an SDL time into a Windows FILETIME (100-nanosecond intervals since January 1, 1601).

This function fills in the two 32-bit values of the FILETIME structure.

ticks
the time to convert.
dwLowDateTime
a pointer filled in with the low portion of the Windows FILETIME value.
dwHighDateTime
a pointer filled in with the high portion of the Windows FILETIME value.
Thread safety
It is safe to call this function from any thread.
C declaration
SDL_TimeToWindows, defined at SDL3/SDL_time.h 180:34

Since: 3.2.0

sDL_TimeFromWindows :: FunPtr (Uint32 -> Uint32 -> IO SDL_Time) Source #

Converts a Windows FILETIME (100-nanosecond intervals since January 1, 1601) to an SDL time.

This function takes the two 32-bit values of the FILETIME structure as parameters.

dwLowDateTime
the low portion of the Windows FILETIME value.
dwHighDateTime
the high portion of the Windows FILETIME value.
Returns
the converted SDL time.
Thread safety
It is safe to call this function from any thread.
C declaration
SDL_TimeFromWindows, defined at SDL3/SDL_time.h 197:38

Since: 3.2.0

sDL_GetDaysInMonth :: FunPtr (CInt -> CInt -> IO CInt) Source #

Get the number of days in a month for a given year.

year
the year.
month
the month [1-12].
Returns
the number of days in the requested month or -1 on failure; call SDL_GetError() for more information.
Thread safety
It is safe to call this function from any thread.
C declaration
SDL_GetDaysInMonth, defined at SDL3/SDL_time.h 211:33

Since: 3.2.0

sDL_GetDayOfYear :: FunPtr (CInt -> CInt -> CInt -> IO CInt) Source #

Get the day of year for a calendar date.

year
the year component of the date.
month
the month component of the date.
day
the day component of the date.
Returns
the day of year [0-365] if the date is valid or -1 on failure; call SDL_GetError() for more information.
Thread safety
It is safe to call this function from any thread.
C declaration
SDL_GetDayOfYear, defined at SDL3/SDL_time.h 226:33

Since: 3.2.0

sDL_GetDayOfWeek :: FunPtr (CInt -> CInt -> CInt -> IO CInt) Source #

Get the day of week for a calendar date.

year
the year component of the date.
month
the month component of the date.
day
the day component of the date.
Returns
a value between 0 and 6 (0 being Sunday) if the date is valid or -1 on failure; call SDL_GetError() for more information.
Thread safety
It is safe to call this function from any thread.
C declaration
SDL_GetDayOfWeek, defined at SDL3/SDL_time.h 241:33

Since: 3.2.0