5#include <SDL3/SDL_init.h>
6#include "SDL3pp_callbackWrapper.h"
7#include "SDL3pp_error.h"
8#include "SDL3pp_events.h"
10#include "SDL3pp_strings.h"
329inline void Quit() { SDL_Quit(); }
409 CheckError(SDL_RunOnMainThread(callback, userdata, wait_complete));
440 void* wrapped = Wrapper::Wrap(std::move(callback));
481 CheckError(SDL_SetAppMetadata(appname, appversion, appidentifier));
544 CheckError(SDL_SetAppMetadataProperty(name, value));
556 SDL_PROP_APP_METADATA_NAME_STRING;
559 SDL_PROP_APP_METADATA_VERSION_STRING;
562 SDL_PROP_APP_METADATA_IDENTIFIER_STRING;
565 SDL_PROP_APP_METADATA_CREATOR_STRING;
568 SDL_PROP_APP_METADATA_COPYRIGHT_STRING;
571 SDL_PROP_APP_METADATA_URL_STRING;
574 SDL_PROP_APP_METADATA_TYPE_STRING;
601 return SDL_GetAppMetadataProperty(name);
604#ifndef SDL3PP_APPCLASS_LOG_PRIORITY
608#define SDL3PP_APPCLASS_LOG_PRIORITY SDL::LOG_PRIORITY_CRITICAL
Helpers to use C++ strings parameters.
Definition SDL3pp_strings.h:58
constexpr void CheckError(bool result)
Check and throw if returned value from SDL is an error.
Definition SDL3pp_error.h:199
SDL_Event Event
The structure for all events in SDL.
Definition SDL3pp_events.h:844
AppResult(SDLCALL *)(void **appstate, int argc, char *argv[]) AppInit_func
Function pointer typedef for SDL_AppInit.
Definition SDL3pp_init.h:150
void Init(InitFlags flags)
Initialize the SDL library.
Definition SDL3pp_init.h:255
void SetAppMetadata(StringParam appname, StringParam appversion, StringParam appidentifier)
Specify basic metadata about your app.
Definition SDL3pp_init.h:477
InitFlags WasInit(InitFlags flags)
Get a mask of the specified subsystems which are currently initialized.
Definition SDL3pp_init.h:309
SDL_AppResult AppResult
Return values for optional main callbacks.
Definition SDL3pp_init.h:115
void(SDLCALL *)(void *appstate, AppResult result) AppQuit_func
Function pointer typedef for SDL_AppQuit.
Definition SDL3pp_init.h:197
void InitSubSystem(InitFlags flags)
Compatibility function to initialize the SDL library.
Definition SDL3pp_init.h:273
constexpr AppResult APP_FAILURE
Value that requests termination with error from the main callbacks.
Definition SDL3pp_init.h:124
constexpr AppResult APP_CONTINUE
Value that requests that the app continue from the main callbacks.
Definition SDL3pp_init.h:118
std::function< void()> MainThreadCB
Callback run on the main thread.
Definition SDL3pp_init.h:378
const char * GetAppMetadataProperty(StringParam name)
Get metadata about your app.
Definition SDL3pp_init.h:599
AppResult(SDLCALL *)(void *appstate, Event *event) AppEvent_func
Function pointer typedef for SDL_AppEvent.
Definition SDL3pp_init.h:183
AppResult(SDLCALL *)(void *appstate) AppIterate_func
Function pointer typedef for SDL_AppIterate.
Definition SDL3pp_init.h:167
void RunOnMainThread(MainThreadCallback callback, void *userdata, bool wait_complete)
Call a function on the main thread during event processing.
Definition SDL3pp_init.h:405
void SetAppMetadataProperty(StringParam name, StringParam value)
Specify metadata about your app through a set of properties.
Definition SDL3pp_init.h:542
void Quit()
Clean up all initialized subsystems.
Definition SDL3pp_init.h:329
void QuitSubSystem(InitFlags flags)
Shut down specific SDL subsystems.
Definition SDL3pp_init.h:293
void(SDLCALL *)(void *userdata) MainThreadCallback
Callback run on the main thread.
Definition SDL3pp_init.h:364
bool IsMainThread()
Return whether this is the main thread.
Definition SDL3pp_init.h:348
constexpr AppResult APP_SUCCESS
Value that requests termination with success from the main callbacks.
Definition SDL3pp_init.h:121
::Uint32 Uint32
An unsigned 32-bit integer type.
Definition SDL3pp_stdinc.h:296
constexpr InitFlags INIT_SENSOR
INIT_SENSOR implies INIT_EVENTS
Definition SDL3pp_init.h:83
constexpr InitFlags INIT_JOYSTICK
INIT_JOYSTICK implies INIT_EVENTS
Definition SDL3pp_init.h:73
constexpr InitFlags INIT_VIDEO
INIT_VIDEO implies INIT_EVENTS, should be initialized on the main thread
Definition SDL3pp_init.h:71
constexpr InitFlags INIT_AUDIO
INIT_AUDIO implies INIT_EVENTS
Definition SDL3pp_init.h:65
constexpr InitFlags INIT_EVENTS
EVENTS.
Definition SDL3pp_init.h:81
constexpr InitFlags INIT_GAMEPAD
INIT_GAMEPAD implies INIT_JOYSTICK
Definition SDL3pp_init.h:78
Uint32 InitFlags
Initialization flags for Init and/or InitSubSystem.
Definition SDL3pp_init.h:63
constexpr InitFlags INIT_HAPTIC
HAPTIC.
Definition SDL3pp_init.h:76
constexpr InitFlags INIT_CAMERA
INIT_CAMERA implies INIT_EVENTS
Definition SDL3pp_init.h:86
Main include header for the SDL3pp library.
Definition SDL3pp_callbackWrapper.h:20