From f5c89b3bd5d74849757fd5b4d1a300068522a3ca Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 6 Mar 2026 13:26:57 -0800 Subject: Initial commit --- SDL-3.2.8/cmake/test/main_lib.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 SDL-3.2.8/cmake/test/main_lib.c (limited to 'SDL-3.2.8/cmake/test/main_lib.c') diff --git a/SDL-3.2.8/cmake/test/main_lib.c b/SDL-3.2.8/cmake/test/main_lib.c new file mode 100644 index 0000000..6aec1f6 --- /dev/null +++ b/SDL-3.2.8/cmake/test/main_lib.c @@ -0,0 +1,34 @@ +#include +#define SDL_MAIN_HANDLED /* don't drag in header-only SDL_main implementation */ +#include + +#include EXPORT_HEADER + +#ifdef _WIN32 +#include +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + return TRUE; +} +#endif + +int MYLIBRARY_EXPORT mylibrary_init(void); +void MYLIBRARY_EXPORT mylibrary_quit(void); +int MYLIBRARY_EXPORT mylibrary_work(void); + +int mylibrary_init(void) { + SDL_SetMainReady(); + if (!SDL_Init(0)) { + SDL_Log("Could not initialize SDL: %s", SDL_GetError()); + return 1; + } + return 0; +} + +void mylibrary_quit(void) { + SDL_Quit(); +} + +int mylibrary_work(void) { + SDL_Delay(100); + return 0; +} -- cgit v1.2.3