mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
253 lines
13 KiB
C#
253 lines
13 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 Init
|
|
{
|
|
/// <summary>
|
|
/// Compatibility function to initialize the SDL library.
|
|
/// </summary>
|
|
/// <param name="flags">any of the flags used by SDL_Init(); see SDL_Init for details.</param>
|
|
/// <returns>
|
|
/// true on success or false on failure; call SDL_GetError() for more
|
|
/// information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function and SDL_Init() are interchangeable.
|
|
/// </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.Init"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.Quit"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.QuitSubSystem"/>
|
|
public static bool InitSubSystem(SdlInitFlags flags) => PInvoke.InitSubSystem(flags) != 0;
|
|
|
|
/// <summary>
|
|
/// Shut down specific SDL subsystems.
|
|
/// </summary>
|
|
/// <param name="flags">any of the flags used by SDL_Init(); see SDL_Init for details.</param>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// You still need to call SDL_Quit() even if you close all open subsystems
|
|
/// with SDL_QuitSubSystem().
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// This function is not thread safe.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.InitSubSystem"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.Quit"/>
|
|
public static void QuitSubSystem(SdlInitFlags flags) => PInvoke.QuitSubSystem(flags);
|
|
|
|
/// <summary>
|
|
/// Get a mask of the specified subsystems which are currently initialized.
|
|
/// </summary>
|
|
/// <param name="flags">any of the flags used by SDL_Init(); see SDL_Init for details.</param>
|
|
/// <returns>
|
|
/// a mask of all initialized subsystems if <c>flags</c> is 0, otherwise it
|
|
/// returns the initialization status of the specified subsystems.
|
|
/// </returns>
|
|
/// <threadsafety>
|
|
/// This function is not thread safe.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.Init"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.InitSubSystem"/>
|
|
public static SdlInitFlags WasInit(SdlInitFlags flags) => PInvoke.WasInit(flags);
|
|
|
|
/// <summary>
|
|
/// Return whether this is the main thread.
|
|
/// </summary>
|
|
/// <returns>true if this thread is the main thread, or false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// On Apple platforms, the main thread is the thread that runs your program's
|
|
/// main() entry point. On other platforms, the main thread is the one that
|
|
/// calls SDL_Init(SDL_INIT_VIDEO), which should usually be the one that runs
|
|
/// your program's main() entry point. If you are using the main callbacks,
|
|
/// SDL_AppInit(), SDL_AppIterate(), and SDL_AppQuit() are all called on the
|
|
/// main thread.
|
|
/// </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.RunOnMainThread"/>
|
|
public static bool IsMainThread() => PInvoke.IsMainThread() != 0;
|
|
|
|
/// <summary>
|
|
/// Specify basic metadata about your app.
|
|
/// </summary>
|
|
/// <param name="appname">
|
|
/// The name of the application ("My Game 2: Bad Guy's
|
|
/// Revenge!").
|
|
/// </param>
|
|
/// <param name="appversion">
|
|
/// The version of the application ("1.0.0beta5" or a git
|
|
/// hash, or whatever makes sense).
|
|
/// </param>
|
|
/// <param name="appidentifier">
|
|
/// A unique string in reverse-domain format that
|
|
/// identifies this app ("com.example.mygame2").
|
|
/// </param>
|
|
/// <returns>
|
|
/// true on success or false on failure; call SDL_GetError() for more
|
|
/// information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// You can optionally provide metadata about your app to SDL. This is not
|
|
/// required, but strongly encouraged.
|
|
/// </para>
|
|
/// <para>
|
|
/// There are several locations where SDL can make use of metadata (an "About"
|
|
/// box in the macOS menu bar, the name of the app can be shown on some audio
|
|
/// mixers, etc). Any piece of metadata can be left as NULL, if a specific
|
|
/// detail doesn't make sense for the app.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function should be called as early as possible, before SDL_Init.
|
|
/// Multiple calls to this function are allowed, but various state might not
|
|
/// change once it has been set up with a previous call to this function.
|
|
/// </para>
|
|
/// <para>
|
|
/// Passing a NULL removes any previous metadata.
|
|
/// </para>
|
|
/// <para>
|
|
/// This is a simplified interface for the most important information. You can
|
|
/// supply significantly more detailed metadata with
|
|
/// SDL_SetAppMetadataProperty().
|
|
/// </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.SetAppMetadataProperty"/>
|
|
public static bool SetAppMetadata(string appname, string appversion, string appidentifier) =>
|
|
PInvoke.SetAppMetadata(appname, appversion, appidentifier) != 0;
|
|
|
|
/// <summary>
|
|
/// Specify metadata about your app through a set of properties.
|
|
/// </summary>
|
|
/// <param name="name">the name of the metadata property to set.</param>
|
|
/// <param name="value">the value of the property, or NULL to remove that property.</param>
|
|
/// <returns>
|
|
/// true on success or false on failure; call SDL_GetError() for more
|
|
/// information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// You can optionally provide metadata about your app to SDL. This is not
|
|
/// required, but strongly encouraged.
|
|
/// </para>
|
|
/// <para>
|
|
/// There are several locations where SDL can make use of metadata (an "About"
|
|
/// box in the macOS menu bar, the name of the app can be shown on some audio
|
|
/// mixers, etc). Any piece of metadata can be left out, if a specific detail
|
|
/// doesn't make sense for the app.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function should be called as early as possible, before SDL_Init.
|
|
/// Multiple calls to this function are allowed, but various state might not
|
|
/// change once it has been set up with a previous call to this function.
|
|
/// </para>
|
|
/// <para>
|
|
/// Once set, this metadata can be read using SDL_GetAppMetadataProperty().
|
|
/// </para>
|
|
/// <para>
|
|
/// These are the supported properties:
|
|
/// </para>
|
|
/// <para>
|
|
/// - <c>SDL_PROP_APP_METADATA_NAME_STRING</c>: The human-readable name of the
|
|
/// application, like "My Game 2: Bad Guy's Revenge!". This will show up
|
|
/// anywhere the OS shows the name of the application separately from window
|
|
/// titles, such as volume control applets, etc. This defaults to "SDL
|
|
/// Application".
|
|
/// - <c>SDL_PROP_APP_METADATA_VERSION_STRING</c>: The version of the app that is
|
|
/// running; there are no rules on format, so "1.0.3beta2" and "April 22nd,
|
|
/// 2024" and a git hash are all valid options. This has no default.
|
|
/// - <c>SDL_PROP_APP_METADATA_IDENTIFIER_STRING</c>: A unique string that
|
|
/// identifies this app. This must be in reverse-domain format, like
|
|
/// "com.example.mygame2". This string is used by desktop compositors to
|
|
/// identify and group windows together, as well as match applications with
|
|
/// associated desktop settings and icons. If you plan to package your
|
|
/// application in a container such as Flatpak, the app ID should match the
|
|
/// name of your Flatpak container as well. This has no default.
|
|
/// - <c>SDL_PROP_APP_METADATA_CREATOR_STRING</c>: The human-readable name of the
|
|
/// creator/developer/maker of this app, like "MojoWorkshop, LLC"
|
|
/// - <c>SDL_PROP_APP_METADATA_COPYRIGHT_STRING</c>: The human-readable copyright
|
|
/// notice, like "Copyright (c) 2024 MojoWorkshop, LLC" or whatnot. Keep this
|
|
/// to one line, don't paste a copy of a whole software license in here. This
|
|
/// has no default.
|
|
/// - <c>SDL_PROP_APP_METADATA_URL_STRING</c>: A URL to the app on the web. Maybe a
|
|
/// product page, or a storefront, or even a GitHub repository, for user's
|
|
/// further information This has no default.
|
|
/// - <c>SDL_PROP_APP_METADATA_TYPE_STRING</c>: The type of application this is.
|
|
/// Currently this string can be "game" for a video game, "mediaplayer" for a
|
|
/// media player, or generically "application" if nothing else applies.
|
|
/// Future versions of SDL might add new types. This defaults to
|
|
/// "application".
|
|
/// </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.GetAppMetadataProperty"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.SetAppMetadata"/>
|
|
public static bool SetAppMetadataProperty(string name, string value) =>
|
|
PInvoke.SetAppMetadataProperty(name, value) != 0;
|
|
|
|
/// <summary>
|
|
/// Get metadata about your app.
|
|
/// </summary>
|
|
/// <param name="name">the name of the metadata property to get.</param>
|
|
/// <returns>
|
|
/// the current value of the metadata property, or the default if it
|
|
/// is not set, NULL for properties with no default.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This returns metadata previously set using SDL_SetAppMetadata() or
|
|
/// SDL_SetAppMetadataProperty(). See SDL_SetAppMetadataProperty() for the list
|
|
/// of available properties and their meanings.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <threadsafety>
|
|
/// It is safe to call this function from any thread, although
|
|
/// the string returned is not protected and could potentially be
|
|
/// freed if you call SDL_SetAppMetadataProperty() to set that
|
|
/// property from another thread.
|
|
/// </threadsafety>
|
|
/// <since>
|
|
/// This function is available since SDL 3.2.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.SetAppMetadata"/>
|
|
/// <seealso cref="Brutal.SdlApi.Sdl.PInvoke.SetAppMetadataProperty"/>
|
|
public static string? GetAppMetadataProperty(string name) => PInvoke.GetAppMetadataProperty(name);
|
|
}
|
|
}
|
|
}
|