mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-26 01:46:20 +08:00
Changed main callback return values to an enumeration
Fixes https://github.com/libsdl-org/SDL/issues/10515
This commit is contained in:
@@ -21,7 +21,7 @@ static float previous_touch_x = -1.0f;
|
||||
static float previous_touch_y = -1.0f;
|
||||
|
||||
/* This function runs once at startup. */
|
||||
int SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
{
|
||||
if (SDL_Init(SDL_INIT_VIDEO) == -1) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
|
||||
@@ -52,7 +52,7 @@ int SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* This function runs when a new event (mouse input, keypresses, etc) occurs. */
|
||||
int SDL_AppEvent(void *appstate, const SDL_Event *event)
|
||||
SDL_AppResult SDL_AppEvent(void *appstate, const SDL_Event *event)
|
||||
{
|
||||
if (event->type == SDL_EVENT_QUIT) {
|
||||
return SDL_APP_SUCCESS; /* end the program, reporting success to the OS. */
|
||||
@@ -84,7 +84,7 @@ int SDL_AppEvent(void *appstate, const SDL_Event *event)
|
||||
}
|
||||
|
||||
/* This function runs once per frame, and is the heart of the program. */
|
||||
int SDL_AppIterate(void *appstate)
|
||||
SDL_AppResult SDL_AppIterate(void *appstate)
|
||||
{
|
||||
/* make sure we're drawing to the window and not the render target */
|
||||
SDL_SetRenderTarget(renderer, NULL);
|
||||
|
||||
Reference in New Issue
Block a user