/*
* ASS (Advanced Streaming Software) - Thin Application Bootstrap
* This file is part of ASS.
*
* ASS is free software: you can redistribute it and/or modify it under the terms of the Affero GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* ASS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Affero GNU
* General Public License for more details.
*
* You should have received a copy of the Affero GNU General Public License along with ASS.
* If not, see
*
* Copyright 2026 ludolpif
*/
#define SDL_MAIN_USE_CALLBACKS 1
#include
#include
#include "ass_metadata.h"
#include "version.h"
SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[])
{
(void) argc;
(void) argv;
SDL_SetAppMetadata(ASS_APP_NAME, ASS_VERSION_STRING, ASS_APP_IDENTIFIER);
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_CREATOR_STRING, ASS_APP_CREATOR);
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_COPYRIGHT_STRING, ASS_APP_COPYRIGHT);
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_URL_STRING, ASS_APP_URL);
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_TYPE_STRING, ASS_APP_TYPE);
if (!SDL_Init(SDL_INIT_VIDEO)) {
return SDL_APP_FAILURE;
}
SDL_Window *window = SDL_CreateWindow("Hello World", 640, 480, 0);
if (!window) {
return SDL_APP_FAILURE;
}
*appstate = window;
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
{
(void) appstate;
if (event->type == SDL_EVENT_QUIT) {
return SDL_APP_SUCCESS;
}
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppIterate(void* appstate)
{
(void) appstate;
return SDL_APP_CONTINUE;
}
void SDL_AppQuit(void* appstate, SDL_AppResult result)
{
(void) result;
SDL_Window *window = (SDL_Window *)appstate;
SDL_DestroyWindow(window);
}