mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 11:12:29 +00:00
chore(build): use SDL3
This commit is contained in:
parent
9d04a35d87
commit
b3c0734a9e
3286 changed files with 866354 additions and 554996 deletions
34
vendor/sdl-3.2.10/cmake/test/main_lib.c
vendored
Normal file
34
vendor/sdl-3.2.10/cmake/test/main_lib.c
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <SDL3/SDL.h>
|
||||
#define SDL_MAIN_HANDLED /* don't drag in header-only SDL_main implementation */
|
||||
#include <SDL3/SDL_main.h>
|
||||
|
||||
#include EXPORT_HEADER
|
||||
|
||||
#ifdef _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)) {
|
||||
SDL_Log("Could not initialize SDL: %s", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mylibrary_quit(void) {
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
int mylibrary_work(void) {
|
||||
SDL_Delay(100);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue