2022-11-28 01:36:54 +08:00
|
|
|
#include <SDL3/SDL.h>
|
2022-12-15 12:58:20 +08:00
|
|
|
#define SDL_MAIN_HANDLED /* don't drag in header-only SDL_main implementation */
|
|
|
|
#include <SDL3/SDL_main.h>
|
2022-09-19 08:38:36 +08:00
|
|
|
|
|
|
|
#include EXPORT_HEADER
|
|
|
|
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#include <windows.h>
|
|
|
|
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) {
|
2023-03-06 06:44:38 +08:00
|
|
|
SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
|
2022-09-19 08:38:36 +08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void mylibrary_quit(void) {
|
|
|
|
SDL_Quit();
|
|
|
|
}
|
|
|
|
|
|
|
|
int mylibrary_work(void) {
|
|
|
|
SDL_Delay(100);
|
|
|
|
return 0;
|
|
|
|
}
|