testnative.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. Copyright (C) 1997-2024 Sam Lantinga <[email protected]>
  3. This software is provided 'as-is', without any express or implied
  4. warranty. In no event will the authors be held liable for any damages
  5. arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it
  8. freely.
  9. */
  10. /* Definitions for platform dependent windowing functions to test SDL
  11. integration with native windows
  12. */
  13. #include <SDL3/SDL.h>
  14. /* Hack to avoid dynapi renaming */
  15. #include "../src/dynapi/SDL_dynapi.h"
  16. #ifdef SDL_DYNAMIC_API
  17. #undef SDL_DYNAMIC_API
  18. #endif
  19. #define SDL_DYNAMIC_API 0
  20. #include "../src/SDL_internal.h"
  21. typedef struct
  22. {
  23. const char *tag;
  24. void *(*CreateNativeWindow)(int w, int h);
  25. void (*DestroyNativeWindow)(void *window);
  26. } NativeWindowFactory;
  27. #ifdef SDL_VIDEO_DRIVER_WINDOWS
  28. #define TEST_NATIVE_WINDOWS
  29. extern NativeWindowFactory WindowsWindowFactory;
  30. #endif
  31. #ifdef SDL_VIDEO_DRIVER_WAYLAND
  32. #define TEST_NATIVE_WAYLAND
  33. extern NativeWindowFactory WaylandWindowFactory;
  34. #endif
  35. #ifdef SDL_VIDEO_DRIVER_X11
  36. #define TEST_NATIVE_X11
  37. extern NativeWindowFactory X11WindowFactory;
  38. #endif
  39. #ifdef SDL_VIDEO_DRIVER_COCOA
  40. #define TEST_NATIVE_COCOA
  41. extern NativeWindowFactory CocoaWindowFactory;
  42. #endif