| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Main.Unsafe
Synopsis
- sDL_SetMainReady :: IO ()
- sDL_RunApp :: CInt -> Ptr (Elem (IncompleteArray (Ptr CChar))) -> SDL_main_func -> Ptr Void -> IO CInt
- sDL_EnterAppMainCallbacks :: CInt -> Ptr (Elem (IncompleteArray (Ptr CChar))) -> SDL_AppInit_func -> SDL_AppIterate_func -> SDL_AppEvent_func -> SDL_AppQuit_func -> IO CInt
- sDL_GDKSuspendComplete :: IO ()
Documentation
sDL_SetMainReady :: IO () Source #
Circumvent failure of SDL_Init() when not using SDL_main() as an entry point.
This function is defined in SDL_main.h, along with the preprocessor rule to redefine main() as SDL_main(). Thus to ensure that your main() function will not be changed it is necessary to define SDL_MAIN_HANDLED before including SDL.h.
- Thread safety
- This function is not thread safe.
- See also
- SDL_Init
- C declaration
SDL_SetMainReady, defined atSDL3/SDL_main.h 549:34
Since: 3.2.0
Arguments
| :: CInt |
|
| -> Ptr (Elem (IncompleteArray (Ptr CChar))) |
|
| -> SDL_main_func |
|
| -> Ptr Void |
|
| -> IO CInt |
Initializes and launches an SDL application, by doing platform-specific initialization before calling your mainFunction and cleanups after it returns, if that is needed for a specific platform, otherwise it just calls mainFunction.
You can use this if you want to use your own main() implementation without using SDL_main (like when using SDL_MAIN_HANDLED). When using this, you do not need SDL_SetMainReady().
If argv is NULL, SDL will provide command line arguments, either by querying the OS for them if possible, or supplying a filler array if not.
- Returns
- the return value from mainFunction: 0 on success, otherwise failure; SDL_GetError() might have more information on the failure.
- Thread safety
- Generally this is called once, near startup, from the process's initial thread.
- C declaration
SDL_RunApp, defined atSDL3/SDL_main.h 582:33
Since: 3.2.0
sDL_EnterAppMainCallbacks Source #
Arguments
| :: CInt |
|
| -> Ptr (Elem (IncompleteArray (Ptr CChar))) |
|
| -> SDL_AppInit_func |
|
| -> SDL_AppIterate_func |
|
| -> SDL_AppEvent_func |
|
| -> SDL_AppQuit_func |
|
| -> IO CInt |
An entry point for SDL's use in SDL_MAIN_USE_CALLBACKS.
Generally, you should not call this function directly. This only exists to hand off work into SDL as soon as possible, where it has a lot more control and functionality available, and make the inline code in SDL_main.h as small as possible.
Not all platforms use this, it's actual use is hidden in a magic header-only library, and you should not call this directly unless you really know what you're doing.
- Returns
- standard Unix main return value.
- Thread safety
- It is not safe to call this anywhere except as the only function call in SDL_main.
- C declaration
SDL_EnterAppMainCallbacks, defined atSDL3/SDL_main.h 609:33
Since: 3.2.0
sDL_GDKSuspendComplete :: IO () Source #
Callback from the application to let the suspend continue.
This should be called from an event watch in response to an SDL_EVENT_DID_ENTER_BACKGROUND event.
When using SDL_Render, your event watch should be added after creating the SDL_Renderer; this allows the timing of the D3D12 command queue suspension to execute in the correct order.
When using SDL_GPU, this should be called after calling SDL_GDKSuspendGPU.
If you're writing your own D3D12 renderer, this should be called after calling ID3D12CommandQueue::SuspendX.
This function is only needed for Xbox GDK support; all other platforms will do nothing and set an "unsupported" error message.
- Thread safety
- This function is not thread safe.
- See also
- SDL_AddEventWatch
- C declaration
SDL_GDKSuspendComplete, defined atSDL3/SDL_main.h 688:34
Since: 3.2.0