testnative.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. Copyright (C) 1997-2025 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. #include "SDL_build_config.h"
  15. typedef struct
  16. {
  17. const char *tag;
  18. void *(*CreateNativeWindow)(int w, int h);
  19. void (*DestroyNativeWindow)(void *window);
  20. } NativeWindowFactory;
  21. #ifdef SDL_VIDEO_DRIVER_WINDOWS
  22. #define TEST_NATIVE_WINDOWS
  23. extern NativeWindowFactory WindowsWindowFactory;
  24. #endif
  25. #ifdef SDL_VIDEO_DRIVER_WAYLAND
  26. #define TEST_NATIVE_WAYLAND
  27. extern NativeWindowFactory WaylandWindowFactory;
  28. #endif
  29. #ifdef SDL_VIDEO_DRIVER_X11
  30. #define TEST_NATIVE_X11
  31. extern NativeWindowFactory X11WindowFactory;
  32. #endif
  33. #ifdef SDL_VIDEO_DRIVER_COCOA
  34. #define TEST_NATIVE_COCOA
  35. extern NativeWindowFactory CocoaWindowFactory;
  36. #endif