testnative.h 1.2 KB

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