aboutsummaryrefslogtreecommitdiff
path: root/libs/SDL
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-02-18 13:19:52 +0100
committerFelix Morgner <felix.morgner@gmail.com>2026-02-18 13:19:52 +0100
commit2a1f31365dade481c32efc3307f94cc052d00f7f (patch)
tree54acaae0d6c18106a82eb263e3b860197908f903 /libs/SDL
parent63fd09807c528915ac5ba6bc9eb11520cbf073e0 (diff)
downloadsnake.s-2a1f31365dade481c32efc3307f94cc052d00f7f.tar.xz
snake.s-2a1f31365dade481c32efc3307f94cc052d00f7f.zip
refactor: split SDL bindings
Diffstat (limited to 'libs/SDL')
-rw-r--r--libs/SDL/error.S8
-rw-r--r--libs/SDL/init.S31
-rw-r--r--libs/SDL/render.S18
-rw-r--r--libs/SDL/video.S23
4 files changed, 80 insertions, 0 deletions
diff --git a/libs/SDL/error.S b/libs/SDL/error.S
new file mode 100644
index 0000000..19efb5a
--- /dev/null
+++ b/libs/SDL/error.S
@@ -0,0 +1,8 @@
+//! @file error.S
+//!
+//! Assembler bindings for SDL2 (SDL_error.h)
+
+//! @fn char const * SDL_GetError(void)
+//! @return the last error message
+.type SDL_GetError, @function
+.extern SDL_GetError \ No newline at end of file
diff --git a/libs/SDL/init.S b/libs/SDL/init.S
new file mode 100644
index 0000000..a2880c8
--- /dev/null
+++ b/libs/SDL/init.S
@@ -0,0 +1,31 @@
+//! @file init.S
+//!
+//! Assembler bindings for SDL2 (SDL.h)
+
+#define SDL_INIT_TIMER 0x00000001u
+#define SDL_INIT_AUDIO 0x00000010u
+#define SDL_INIT_VIDEO 0x00000020u
+#define SDL_INIT_JOYSTICK 0x00000200u
+#define SDL_INIT_HAPTIC 0x00001000u
+#define SDL_INIT_GAMECONTROLLER 0x00002000u
+#define SDL_INIT_EVENTS 0x00004000u
+#define SDL_INIT_SENSOR 0x00008000u
+#define SDL_INIT_NOPARACHUTE 0x00100000u
+#define SDL_INIT_EVERYTHIN (SDL_INIT_TIMER | \
+ SDL_INIT_AUDIO | \
+ SDL_INIT_VIDEO | \
+ SDL_INIT_EVENTS | \
+ SDL_INIT_JOYSTICK | \
+ SDL_INIT_HAPTIC | \
+ SDL_INIT_GAMECONTROLLER | \
+ SDL_INIT_SENSOR)
+
+//! @fn int SDL_Init(UInt32 flags)
+//! @param flags subsystem initialization flags
+//! @return 0 on success, a negative error code on failure
+.type SDL_Init, @function
+.extern SDL_Init
+
+//! @fn void SDL_Quit(void)
+.type SDL_Quit, @function
+.extern SDL_Quit \ No newline at end of file
diff --git a/libs/SDL/render.S b/libs/SDL/render.S
new file mode 100644
index 0000000..d422971
--- /dev/null
+++ b/libs/SDL/render.S
@@ -0,0 +1,18 @@
+//! @file render.S
+//!
+//! Assembler bindings for SDL2 (SDL_render.h)
+
+#define SDL_RENDERER_ACCELERATED 0x00000002u
+
+//! @fn SDL_Renderer * SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags);
+//! @param the window where rendering is displayed.
+//! @param index the index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags
+//! @param flags 0, or one or more SDL_RendererFlags OR'd together.
+//! @return a valid rendering context or NULL on error.
+.type SDL_CreateRenderer, @function
+.extern SDL_CreateRenderer
+
+//! @fn void SDL_DestroyRenderer(SDL_Renderer * renderer);
+//! @param renderer the renderer to destroy
+.type SDL_DestroyRenderer, @function
+.extern SDL_DestroyRenderer \ No newline at end of file
diff --git a/libs/SDL/video.S b/libs/SDL/video.S
new file mode 100644
index 0000000..f91cc89
--- /dev/null
+++ b/libs/SDL/video.S
@@ -0,0 +1,23 @@
+//! @file video.S
+//!
+//! Assembler bindings for SDL2 (SDL_video.h)
+
+#define SDL_WINDOW_SHOWN 0x00000004u
+
+#define SDL_WINDOWPOS_UNDEFINED 0x1FFF0000u
+
+//! @fn SDL_Window * SDL_CreateWindow(const char *title, int x, int y, int w, int h, uint32_t flags)
+//! @param title the window title
+//! @param x the X position of the window, or SDL_WINDOWPOS_UNDEFINED
+//! @param y the Y position of the window, or SDL_WINDOWPOS_UNDEFINED
+//! @param w the width of the window
+//! @param h the height of the window
+//! @param flags 0, or one or more SDL_WindowFlags OR'd together.
+//! @return a valid window or NULL on error
+.type SDL_CreateWindow, @function
+.extern SDL_CreateWindow
+
+//! @fn void SDL_DestroyWindow(SDL_Window *window)
+//! @param window the window to destroy
+.type SDL_DestroyWindow, @function
+.extern SDL_DestroyWindow