diff options
Diffstat (limited to 'src/contrib/SDL-2.30.2/cmake/test/main_lib.c')
| -rw-r--r-- | src/contrib/SDL-2.30.2/cmake/test/main_lib.c | 33 |
1 files changed, 33 insertions, 0 deletions
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 @@ | |||
| 1 | #include "SDL.h" | ||
| 2 | #include <stdio.h> | ||
| 3 | |||
| 4 | #include EXPORT_HEADER | ||
| 5 | |||
| 6 | #if defined(_WIN32) | ||
| 7 | #include <windows.h> | ||
| 8 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { | ||
| 9 | return TRUE; | ||
| 10 | } | ||
| 11 | #endif | ||
| 12 | |||
| 13 | int MYLIBRARY_EXPORT mylibrary_init(void); | ||
| 14 | void MYLIBRARY_EXPORT mylibrary_quit(void); | ||
| 15 | int MYLIBRARY_EXPORT mylibrary_work(void); | ||
| 16 | |||
| 17 | int mylibrary_init(void) { | ||
| 18 | SDL_SetMainReady(); | ||
| 19 | if (SDL_Init(0) < 0) { | ||
| 20 | fprintf(stderr, "could not initialize sdl2: %s\n", SDL_GetError()); | ||
| 21 | return 1; | ||
| 22 | } | ||
| 23 | return 0; | ||
| 24 | } | ||
| 25 | |||
| 26 | void mylibrary_quit(void) { | ||
| 27 | SDL_Quit(); | ||
| 28 | } | ||
| 29 | |||
| 30 | int mylibrary_work(void) { | ||
| 31 | SDL_Delay(100); | ||
| 32 | return 0; | ||
| 33 | } | ||
