bgfxplatform.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_LINUX
  12. # include <X11/Xlib.h>
  13. namespace bgfx
  14. {
  15. void x11SetDisplayWindow(::Display* _display, ::Window _window);
  16. } // namespace bgfx
  17. #elif BX_PLATFORM_NACL
  18. # include <ppapi/c/ppb_graphics_3d.h>
  19. # include <ppapi/c/ppb_instance.h>
  20. namespace bgfx
  21. {
  22. typedef void (*PostSwapBuffersFn)(uint32_t _width, uint32_t _height);
  23. void naclSetIntefraces(::PP_Instance, const ::PPB_Instance*, const ::PPB_Graphics3D*, PostSwapBuffersFn);
  24. } // namespace bgfx
  25. #elif BX_PLATFORM_WINDOWS
  26. # include <windows.h>
  27. namespace bgfx
  28. {
  29. void winSetHwnd(::HWND _hwnd);
  30. } // namespace bgfx
  31. #elif BX_PLATFORM_OSX
  32. # include <Cocoa/Cocoa.h>
  33. # include <stdlib.h>
  34. namespace bgfx
  35. {
  36. void osxSetNSWindow(void* _nsWindow);
  37. } // namespace bgfx
  38. #endif // BX_PLATFORM_
  39. #endif // __BGFXPLATFORM_H__