bgfxplatform.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2011-2013 Branimir Karadzic. All rights reserved.
  3. * License: http://www.opensource.org/licenses/BSD-2-Clause
  4. */
  5. #ifndef __BGFXPLATFORM_H__
  6. #define __BGFXPLATFORM_H__
  7. // NOTICE:
  8. // This header file contains platform specific interfaces. It is only
  9. // necessary to use this header in conjunction with creating windows.
  10. #include <bx/bx.h>
  11. #if BX_PLATFORM_ANDROID
  12. # include <android/native_window.h>
  13. namespace bgfx
  14. {
  15. void androidSetWindow(::ANativeWindow* _window);
  16. } // namespace bgfx
  17. #elif BX_PLATFORM_IOS
  18. namespace bgfx
  19. {
  20. void iosSetEaglLayer(void* _layer);
  21. } // namespace bgfx
  22. #elif BX_PLATFORM_LINUX
  23. # include <X11/Xlib.h>
  24. namespace bgfx
  25. {
  26. void x11SetDisplayWindow(::Display* _display, ::Window _window);
  27. } // namespace bgfx
  28. #elif BX_PLATFORM_NACL
  29. # include <ppapi/c/ppb_graphics_3d.h>
  30. # include <ppapi/c/ppb_instance.h>
  31. namespace bgfx
  32. {
  33. typedef void (*PostSwapBuffersFn)(uint32_t _width, uint32_t _height);
  34. void naclSetIntefraces(::PP_Instance, const ::PPB_Instance*, const ::PPB_Graphics3D*, PostSwapBuffersFn);
  35. } // namespace bgfx
  36. #elif BX_PLATFORM_OSX
  37. # include <Cocoa/Cocoa.h>
  38. # include <stdlib.h>
  39. namespace bgfx
  40. {
  41. void osxSetNSWindow(void* _window);
  42. } // namespace bgfx
  43. #elif BX_PLATFORM_WINDOWS
  44. # include <windows.h>
  45. namespace bgfx
  46. {
  47. void winSetHwnd(::HWND _window);
  48. } // namespace bgfx
  49. #endif // BX_PLATFORM_
  50. #endif // __BGFXPLATFORM_H__