🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
644 B

  1. #include "SDL.h"
  2. #include <stdio.h>
  3. #include EXPORT_HEADER
  4. #if defined(_WIN32)
  5. #include <windows.h>
  6. BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
  7. return TRUE;
  8. }
  9. #endif
  10. int MYLIBRARY_EXPORT mylibrary_init(void);
  11. void MYLIBRARY_EXPORT mylibrary_quit(void);
  12. int MYLIBRARY_EXPORT mylibrary_work(void);
  13. int mylibrary_init(void) {
  14. SDL_SetMainReady();
  15. if (SDL_Init(0) < 0) {
  16. fprintf(stderr, "could not initialize sdl2: %s\n", SDL_GetError());
  17. return 1;
  18. }
  19. return 0;
  20. }
  21. void mylibrary_quit(void) {
  22. SDL_Quit();
  23. }
  24. int mylibrary_work(void) {
  25. SDL_Delay(100);
  26. return 0;
  27. }