From 8222bfe56d4dabe8d92fc4b25ea1b0163b16f3e1 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 4 May 2024 16:51:29 -0700 Subject: Initial commit. --- src/contrib/SDL-2.30.2/cmake/test/main_lib.c | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/contrib/SDL-2.30.2/cmake/test/main_lib.c (limited to 'src/contrib/SDL-2.30.2/cmake/test/main_lib.c') diff --git a/src/contrib/SDL-2.30.2/cmake/test/main_lib.c b/src/contrib/SDL-2.30.2/cmake/test/main_lib.c new file mode 100644 index 0000000..9801ed5 --- /dev/null +++ b/src/contrib/SDL-2.30.2/cmake/test/main_lib.c @@ -0,0 +1,33 @@ +#include "SDL.h" +#include + +#include EXPORT_HEADER + +#if defined(_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) < 0) { + fprintf(stderr, "could not initialize sdl2: %s\n", 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