summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorludolpif <ludolpif@ass-project.org>2026-11-29 00:01:11 +0100
committerludolpif <ludolpif@ass-project.org>2026-11-29 00:01:11 +0100
commit88e891a048cc2b0c9f7b201bf62fa9845d182aeb (patch)
tree8a4599804de492f5030f8846657a886a88efc763 /src/app
downloadass-88e891a048cc2b0c9f7b201bf62fa9845d182aeb.tar.gz
ass-88e891a048cc2b0c9f7b201bf62fa9845d182aeb.tar.bz2
ass-88e891a048cc2b0c9f7b201bf62fa9845d182aeb.zip
feat(app): SDL3 Hello World with meson build files and scripts for linux onlyHEADmain
Signed-off-by: ludolpif <ludolpif@ass-project.org>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/main.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/app/main.c b/src/app/main.c
new file mode 100644
index 0000000..52f39c2
--- /dev/null
+++ b/src/app/main.c
@@ -0,0 +1,68 @@
+/*
+ * 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 <https://www.gnu.org/licenses/>
+ *
+ * Copyright 2026 ludolpif <ludolpif@gmail.com>
+ */
+
+#define SDL_MAIN_USE_CALLBACKS 1
+#include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
+#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);
+}