testnative.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. Copyright (C) 1997-2014 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 "SDL.h"
  14. /* This header includes all the necessary system headers for native windows */
  15. #include "SDL_syswm.h"
  16. typedef struct
  17. {
  18. const char *tag;
  19. void *(*CreateNativeWindow) (int w, int h);
  20. void (*DestroyNativeWindow) (void *window);
  21. } NativeWindowFactory;
  22. #ifdef SDL_VIDEO_DRIVER_WINDOWS
  23. #define TEST_NATIVE_WINDOWS
  24. extern NativeWindowFactory WindowsWindowFactory;
  25. #endif
  26. #ifdef SDL_VIDEO_DRIVER_X11
  27. #define TEST_NATIVE_X11
  28. extern NativeWindowFactory X11WindowFactory;
  29. #endif
  30. #ifdef SDL_VIDEO_DRIVER_COCOA
  31. /* Actually, we don't really do this, since it involves adding Objective C
  32. support to the build system, which is a little tricky. You can uncomment
  33. it manually though and link testnativecocoa.m into the test application.
  34. */
  35. #define TEST_NATIVE_COCOA
  36. extern NativeWindowFactory CocoaWindowFactory;
  37. #endif