mirror of
https://github.com/shadps4-emu/ext-SDL.git
synced 2025-02-19 18:21:21 +00:00

.. including cmake/test/*.c, whatever that does (this is needed now because SDL.h doesn't include SDL_main.h anymore)
36 lines
756 B
C
36 lines
756 B
C
#include <SDL3/SDL.h>
|
|
#define SDL_MAIN_HANDLED /* don't drag in header-only SDL_main implementation */
|
|
#include <SDL3/SDL_main.h>
|
|
#include <stdio.h>
|
|
|
|
#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) {
|
|
fprintf(stderr, "Could not initialize SDL: %s\n", SDL_GetError());
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void mylibrary_quit(void) {
|
|
SDL_Quit();
|
|
}
|
|
|
|
int mylibrary_work(void) {
|
|
SDL_Delay(100);
|
|
return 0;
|
|
}
|