1
0

testnative.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
  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. #include "../src/SDL_internal.h"
  20. typedef struct
  21. {
  22. const char *tag;
  23. void *(*CreateNativeWindow)(int w, int h);
  24. void (*DestroyNativeWindow)(void *window);
  25. } NativeWindowFactory;
  26. #ifdef SDL_VIDEO_DRIVER_WINDOWS
  27. #define TEST_NATIVE_WINDOWS
  28. extern NativeWindowFactory WindowsWindowFactory;
  29. #endif
  30. #ifdef SDL_VIDEO_DRIVER_X11
  31. #define TEST_NATIVE_X11
  32. extern NativeWindowFactory X11WindowFactory;
  33. #endif
  34. #ifdef SDL_VIDEO_DRIVER_COCOA
  35. #define TEST_NATIVE_COCOA
  36. extern NativeWindowFactory CocoaWindowFactory;
  37. #endif