mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
557 lines
27 KiB
C#
557 lines
27 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Sdl.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
namespace Brutal.SdlApi
|
|
{
|
|
public static unsafe partial class Sdl
|
|
{
|
|
public static unsafe partial class Events
|
|
{
|
|
/// <summary>
|
|
/// Pump the event loop, gathering events from the input devices.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function updates the event queue and internal input device state.
|
|
/// </para>
|
|
/// <para>
|
|
/// SDL_PumpEvents() gathers all the pending input information from devices and
|
|
/// places it in the event queue. Without calls to SDL_PumpEvents() no events
|
|
/// would ever be placed on the queue. Often the need for calls to
|
|
/// SDL_PumpEvents() is hidden from the user since SDL_PollEvent() and
|
|
/// SDL_WaitEvent() implicitly call SDL_PumpEvents(). However, if you are not
|
|
/// polling or waiting for events (e.g. you are filtering them), then you must
|
|
/// call SDL_PumpEvents() to force an event queue update.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// This function should only be called on the main thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PollEvent"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.WaitEvent"/>
|
|
public static void PumpEvents()
|
|
{
|
|
PInvoke.PumpEvents();
|
|
Sdl.ExceptionAggregator.CheckExceptions();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Check the event queue for messages and optionally return them.
|
|
/// </summary>
|
|
/// <param name="events">
|
|
/// destination buffer for the retrieved events, may be NULL to
|
|
/// leave the events in the queue and return the number of events
|
|
/// that would have been stored.
|
|
/// </param>
|
|
/// <param name="numevents">
|
|
/// if action is SDL_ADDEVENT, the number of events to add
|
|
/// back to the event queue; if action is SDL_PEEKEVENT or
|
|
/// SDL_GETEVENT, the maximum number of events to retrieve.
|
|
/// </param>
|
|
/// <param name="action">action to take; see [Remarks](#remarks) for details.</param>
|
|
/// <param name="minType">
|
|
/// minimum value of the event type to be considered;
|
|
/// SDL_EVENT_FIRST is a safe choice.
|
|
/// </param>
|
|
/// <param name="maxType">
|
|
/// maximum value of the event type to be considered;
|
|
/// SDL_EVENT_LAST is a safe choice.
|
|
/// </param>
|
|
/// <returns>
|
|
/// the number of events actually stored or -1 on failure; call
|
|
/// SDL_GetError() for more information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// <c>action</c> may be any of the following:
|
|
/// </para>
|
|
/// <para>
|
|
/// - <c>SDL_ADDEVENT</c>: up to <c>numevents</c> events will be added to the back of the
|
|
/// event queue.
|
|
/// - <c>SDL_PEEKEVENT</c>: <c>numevents</c> events at the front of the event queue,
|
|
/// within the specified minimum and maximum type, will be returned to the
|
|
/// caller and will <em>not</em> be removed from the queue. If you pass NULL for
|
|
/// <c>events</c>, then <c>numevents</c> is ignored and the total number of matching
|
|
/// events will be returned.
|
|
/// - <c>SDL_GETEVENT</c>: up to <c>numevents</c> events at the front of the event queue,
|
|
/// within the specified minimum and maximum type, will be returned to the
|
|
/// caller and will be removed from the queue.
|
|
/// </para>
|
|
/// <para>
|
|
/// You may have to call SDL_PumpEvents() before calling this function.
|
|
/// Otherwise, the events may not be ready to be filtered when you call
|
|
/// SDL_PeepEvents().
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PollEvent"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PumpEvents"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PushEvent"/>
|
|
public static int PeepEvents(
|
|
SdlEvent* events,
|
|
int numevents,
|
|
SdlEventAction action,
|
|
uint minType,
|
|
uint maxType
|
|
) => PInvoke.PeepEvents(events, numevents, action, minType, maxType);
|
|
|
|
/// <summary>
|
|
/// Check for the existence of a certain event type in the event queue.
|
|
/// </summary>
|
|
/// <param name="type">the type of event to be queried; see SDL_EventType for details.</param>
|
|
/// <returns>
|
|
/// true if events matching <c>type</c> are present, or false if events
|
|
/// matching <c>type</c> are not present.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// If you need to check for a range of event types, use SDL_HasEvents()
|
|
/// instead.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.HasEvents"/>
|
|
public static bool HasEvent(uint type) => PInvoke.HasEvent(type) != 0;
|
|
|
|
/// <summary>
|
|
/// Check for the existence of certain event types in the event queue.
|
|
/// </summary>
|
|
/// <param name="minType">
|
|
/// the low end of event type to be queried, inclusive; see
|
|
/// SDL_EventType for details.
|
|
/// </param>
|
|
/// <param name="maxType">
|
|
/// the high end of event type to be queried, inclusive; see
|
|
/// SDL_EventType for details.
|
|
/// </param>
|
|
/// <returns>
|
|
/// true if events with type >= <c>minType</c> and <= <c>maxType</c> are
|
|
/// present, or false if not.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// If you need to check for a single event type, use SDL_HasEvent() instead.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.HasEvents"/>
|
|
public static bool HasEvents(uint minType, uint maxType) => PInvoke.HasEvents(minType, maxType) != 0;
|
|
|
|
/// <summary>
|
|
/// Clear events of a specific type from the event queue.
|
|
/// </summary>
|
|
/// <param name="type">the type of event to be cleared; see SDL_EventType for details.</param>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This will unconditionally remove any events from the queue that match
|
|
/// <c>type</c>. If you need to remove a range of event types, use SDL_FlushEvents()
|
|
/// instead.
|
|
/// </para>
|
|
/// <para>
|
|
/// It's also normal to just ignore events you don't care about in your event
|
|
/// loop without calling this function.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function only affects currently queued events. If you want to make
|
|
/// sure that all pending OS events are flushed, you can call SDL_PumpEvents()
|
|
/// on the main thread immediately before the flush call.
|
|
/// </para>
|
|
/// <para>
|
|
/// If you have user events with custom data that needs to be freed, you should
|
|
/// use SDL_PeepEvents() to remove and clean up those events before calling
|
|
/// this function.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.FlushEvents"/>
|
|
public static void FlushEvent(uint type) => PInvoke.FlushEvent(type);
|
|
|
|
/// <summary>
|
|
/// Clear events of a range of types from the event queue.
|
|
/// </summary>
|
|
/// <param name="minType">
|
|
/// the low end of event type to be cleared, inclusive; see
|
|
/// SDL_EventType for details.
|
|
/// </param>
|
|
/// <param name="maxType">
|
|
/// the high end of event type to be cleared, inclusive; see
|
|
/// SDL_EventType for details.
|
|
/// </param>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This will unconditionally remove any events from the queue that are in the
|
|
/// range of <c>minType</c> to <c>maxType</c>, inclusive. If you need to remove a single
|
|
/// event type, use SDL_FlushEvent() instead.
|
|
/// </para>
|
|
/// <para>
|
|
/// It's also normal to just ignore events you don't care about in your event
|
|
/// loop without calling this function.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function only affects currently queued events. If you want to make
|
|
/// sure that all pending OS events are flushed, you can call SDL_PumpEvents()
|
|
/// on the main thread immediately before the flush call.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.FlushEvent"/>
|
|
public static void FlushEvents(uint minType, uint maxType) => PInvoke.FlushEvents(minType, maxType);
|
|
|
|
/// <summary>
|
|
/// Poll for currently pending events.
|
|
/// </summary>
|
|
/// <param name="event">
|
|
/// the SDL_Event structure to be filled with the next event from
|
|
/// the queue, or NULL.
|
|
/// </param>
|
|
/// <returns>true if this got an event or false if there are none available.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// If <c>event</c> is not NULL, the next event is removed from the queue and stored
|
|
/// in the SDL_Event structure pointed to by <c>event</c>.
|
|
/// </para>
|
|
/// <para>
|
|
/// If <c>event</c> is NULL, it simply returns true if there is an event in the
|
|
/// queue, but will not remove it from the queue.
|
|
/// </para>
|
|
/// <para>
|
|
/// As this function may implicitly call SDL_PumpEvents(), you can only call
|
|
/// this function in the thread that initialized the video subsystem.
|
|
/// </para>
|
|
/// <para>
|
|
/// SDL_PollEvent() is the favored way of receiving system events since it can
|
|
/// be done from the main loop and does not suspend the main loop while waiting
|
|
/// on an event to be posted.
|
|
/// </para>
|
|
/// <para>
|
|
/// The common practice is to fully process the event queue once every frame,
|
|
/// usually as a first step before updating the game's state:
|
|
/// </para>
|
|
/// <para>
|
|
/// ```c
|
|
/// while (game_is_still_running) {
|
|
/// SDL_Event event;
|
|
/// while (SDL_PollEvent(&event)) { // poll until all events are handled!
|
|
/// // decide what to do with this event.
|
|
/// }
|
|
/// </para>
|
|
/// <para>
|
|
/// // update game state, draw the current frame
|
|
/// }
|
|
/// ```
|
|
/// </para>
|
|
/// <para>
|
|
/// Note that Windows (and possibly other platforms) has a quirk about how it
|
|
/// handles events while dragging/resizing a window, which can cause this
|
|
/// function to block for significant amounts of time. Technical explanations
|
|
/// and solutions are discussed on the wiki:
|
|
/// </para>
|
|
/// <para>
|
|
/// https://wiki.libsdl.org/SDL3/AppFreezeDuringDrag
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// This function should only be called on the main thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PushEvent"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.WaitEvent"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.WaitEventTimeout"/>
|
|
public static bool PollEvent(SdlEvent* @event)
|
|
{
|
|
bool result = PInvoke.PollEvent(@event) != 0;
|
|
Sdl.ExceptionAggregator.CheckExceptions();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Wait indefinitely for the next available event.
|
|
/// </summary>
|
|
/// <param name="event">
|
|
/// the SDL_Event structure to be filled in with the next event
|
|
/// from the queue, or NULL.
|
|
/// </param>
|
|
/// <returns>
|
|
/// true on success or false if there was an error while waiting for
|
|
/// events; call SDL_GetError() for more information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// If <c>event</c> is not NULL, the next event is removed from the queue and stored
|
|
/// in the SDL_Event structure pointed to by <c>event</c>.
|
|
/// </para>
|
|
/// <para>
|
|
/// As this function may implicitly call SDL_PumpEvents(), you can only call
|
|
/// this function in the thread that initialized the video subsystem.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// This function should only be called on the main thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PollEvent"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PushEvent"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.WaitEventTimeout"/>
|
|
public static bool WaitEvent(SdlEvent* @event)
|
|
{
|
|
bool result = PInvoke.WaitEvent(@event) != 0;
|
|
Sdl.ExceptionAggregator.CheckExceptions();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Wait until the specified timeout (in milliseconds) for the next available
|
|
/// event.
|
|
/// </summary>
|
|
/// <param name="event">
|
|
/// the SDL_Event structure to be filled in with the next event
|
|
/// from the queue, or NULL.
|
|
/// </param>
|
|
/// <param name="timeoutMS">
|
|
/// the maximum number of milliseconds to wait for the next
|
|
/// available event.
|
|
/// </param>
|
|
/// <returns>
|
|
/// true if this got an event or false if the timeout elapsed without
|
|
/// any events available.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// If <c>event</c> is not NULL, the next event is removed from the queue and stored
|
|
/// in the SDL_Event structure pointed to by <c>event</c>.
|
|
/// </para>
|
|
/// <para>
|
|
/// As this function may implicitly call SDL_PumpEvents(), you can only call
|
|
/// this function in the thread that initialized the video subsystem.
|
|
/// </para>
|
|
/// <para>
|
|
/// The timeout is not guaranteed, the actual wait time could be longer due to
|
|
/// system scheduling.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// This function should only be called on the main thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PollEvent"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PushEvent"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.WaitEvent"/>
|
|
public static bool WaitEventTimeout(SdlEvent* @event, int timeoutMS)
|
|
{
|
|
bool result = PInvoke.WaitEventTimeout(@event, timeoutMS) != 0;
|
|
Sdl.ExceptionAggregator.CheckExceptions();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Add an event to the event queue.
|
|
/// </summary>
|
|
/// <param name="event">the SDL_Event to be added to the queue.</param>
|
|
/// <returns>
|
|
/// true on success, false if the event was filtered or on failure;
|
|
/// call SDL_GetError() for more information. A common reason for
|
|
/// error is the event queue being full.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The event queue can actually be used as a two way communication channel.
|
|
/// Not only can events be read from the queue, but the user can also push
|
|
/// their own events onto it. <c>event</c> is a pointer to the event structure you
|
|
/// wish to push onto the queue. The event is copied into the queue, and the
|
|
/// caller may dispose of the memory pointed to after SDL_PushEvent() returns.
|
|
/// </para>
|
|
/// <para>
|
|
/// Note: Pushing device input events onto the queue doesn't modify the state
|
|
/// of the device within SDL.
|
|
/// </para>
|
|
/// <para>
|
|
/// Note: Events pushed onto the queue with SDL_PushEvent() get passed through
|
|
/// the event filter but events added with SDL_PeepEvents() do not.
|
|
/// </para>
|
|
/// <para>
|
|
/// For pushing application-specific events, please use SDL_RegisterEvents() to
|
|
/// get an event type that does not conflict with other code that also wants
|
|
/// its own custom event types.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PeepEvents"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PollEvent"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.RegisterEvents"/>
|
|
public static bool PushEvent(SdlEvent* @event)
|
|
{
|
|
bool result = PInvoke.PushEvent(@event) != 0;
|
|
Sdl.ExceptionAggregator.CheckExceptions();
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Query the current event filter.
|
|
/// </summary>
|
|
/// <param name="filter">the current callback function will be stored here.</param>
|
|
/// <param name="userdata">
|
|
/// the pointer that is passed to the current event filter will
|
|
/// be stored here.
|
|
/// </param>
|
|
/// <returns>true on success or false if there is no event filter set.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function can be used to "chain" filters, by saving the existing filter
|
|
/// before replacing it with a function that will call that saved filter.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.SetEventFilter"/>
|
|
public static bool GetEventFilter(
|
|
delegate* unmanaged[Cdecl]<void*, SdlEvent*, byte>* filter,
|
|
void** userdata
|
|
) => PInvoke.GetEventFilter(filter, userdata) != 0;
|
|
|
|
/// <summary>
|
|
/// Set the state of processing events by type.
|
|
/// </summary>
|
|
/// <param name="type">the type of event; see SDL_EventType for details.</param>
|
|
/// <param name="enabled">whether to process the event or not.</param>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.EventEnabled"/>
|
|
public static void SetEventEnabled(uint type, bool enabled) =>
|
|
PInvoke.SetEventEnabled(type, enabled ? (byte)1 : (byte)0);
|
|
|
|
/// <summary>
|
|
/// Query the state of processing events by type.
|
|
/// </summary>
|
|
/// <param name="type">the type of event; see SDL_EventType for details.</param>
|
|
/// <returns>true if the event is being processed, false otherwise.</returns>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.SetEventEnabled"/>
|
|
public static bool EventEnabled(uint type) => PInvoke.EventEnabled(type) != 0;
|
|
|
|
/// <summary>
|
|
/// Allocate a set of user-defined events, and return the beginning event
|
|
/// number for that set of events.
|
|
/// </summary>
|
|
/// <param name="numevents">the number of events to be allocated.</param>
|
|
/// <returns>
|
|
/// the beginning event number, or 0 if numevents is invalid or if
|
|
/// there are not enough user-defined events left.
|
|
/// </returns>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.PushEvent"/>
|
|
public static uint RegisterEvents(int numevents) => PInvoke.RegisterEvents(numevents);
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>SDL_GetWindowFromEvent</c>.
|
|
/// </summary>
|
|
/// <param name="event">an event containing a <c>windowID</c>.</param>
|
|
/// <remarks>
|
|
/// <b>Borrowed handle:</b> the returned handle is owned by SDL (or by another object) and must not be
|
|
/// disposed. Do not call <see cref="System.IDisposable.Dispose"/> on it; doing so would free a resource
|
|
/// this call does not own. A null handle is returned on failure.
|
|
/// </remarks>
|
|
public static SdlWindow GetWindowFromEvent(SdlEvent* @event) => PInvoke.GetWindowFromEvent(@event);
|
|
|
|
/// <summary>
|
|
/// Generate an English description of an event.
|
|
/// </summary>
|
|
/// <param name="event">an event to describe. May be NULL.</param>
|
|
/// <param name="buf">the buffer to fill with the description string. May be NULL.</param>
|
|
/// <param name="buflen">the maximum bytes that can be written to <c>buf</c>.</param>
|
|
/// <returns>
|
|
/// number of bytes needed for the full string, not counting the
|
|
/// null-terminator byte.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This will fill <c>buf</c> with a null-terminated string that might look
|
|
/// something like this:
|
|
/// </para>
|
|
/// <para>
|
|
/// ```
|
|
/// SDL_EVENT_MOUSE_MOTION (timestamp=1140256324 windowid=2 which=0 state=0 x=492.99 y=139.09 xrel=52
|
|
/// yrel=6)
|
|
/// ```
|
|
/// </para>
|
|
/// <para>
|
|
/// The exact format of the string is not guaranteed; it is intended for
|
|
/// logging purposes, to be read by a human, and not parsed by a computer.
|
|
/// </para>
|
|
/// <para>
|
|
/// The returned value follows the same rules as SDL_snprintf(): <c>buf</c> will
|
|
/// always be NULL-terminated (unless <c>buflen</c> is zero), and will be truncated
|
|
/// if <c>buflen</c> is too small. The return code is the number of bytes needed for
|
|
/// the complete string, not counting the NULL-terminator, whether the string
|
|
/// was truncated or not. Unlike SDL_snprintf(), though, this function never
|
|
/// returns -1.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.4.0.
|
|
/// </since>
|
|
public static int GetEventDescription(SdlEvent* @event, byte* buf, int buflen) =>
|
|
PInvoke.GetEventDescription(@event, buf, buflen);
|
|
}
|
|
}
|
|
}
|