summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/cmake/test/main_lib.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
committer3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
commit6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch)
tree34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/cmake/test/main_lib.c
parent8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff)
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/cmake/test/main_lib.c')
-rw-r--r--src/contrib/SDL-3.2.20/cmake/test/main_lib.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/cmake/test/main_lib.c b/src/contrib/SDL-3.2.20/cmake/test/main_lib.c
new file mode 100644
index 0000000..6aec1f6
--- /dev/null
+++ b/src/contrib/SDL-3.2.20/cmake/test/main_lib.c
@@ -0,0 +1,34 @@
1#include <SDL3/SDL.h>
2#define SDL_MAIN_HANDLED /* don't drag in header-only SDL_main implementation */
3#include <SDL3/SDL_main.h>
4
5#include EXPORT_HEADER
6
7#ifdef _WIN32
8#include <windows.h>
9BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
10 return TRUE;
11}
12#endif
13
14int MYLIBRARY_EXPORT mylibrary_init(void);
15void MYLIBRARY_EXPORT mylibrary_quit(void);
16int MYLIBRARY_EXPORT mylibrary_work(void);
17
18int mylibrary_init(void) {
19 SDL_SetMainReady();
20 if (!SDL_Init(0)) {
21 SDL_Log("Could not initialize SDL: %s", SDL_GetError());
22 return 1;
23 }
24 return 0;
25}
26
27void mylibrary_quit(void) {
28 SDL_Quit();
29}
30
31int mylibrary_work(void) {
32 SDL_Delay(100);
33 return 0;
34}