bgfxplatform.c99.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
  4. *
  5. * vim: set tabstop=4 expandtab:
  6. */
  7. #ifndef BGFX_PLATFORM_C99_H_HEADER_GUARD
  8. #define BGFX_PLATFORM_C99_H_HEADER_GUARD
  9. // NOTICE:
  10. // This header file contains platform specific interfaces. It is only
  11. // necessary to use this header in conjunction with creating windows.
  12. #include <bx/platform.h>
  13. typedef enum bgfx_render_frame
  14. {
  15. BGFX_RENDER_FRAME_NO_CONTEXT,
  16. BGFX_RENDER_FRAME_RENDER,
  17. BGFX_RENDER_FRAME_EXITING,
  18. BGFX_RENDER_FRAME_COUNT
  19. } bgfx_render_frame_t;
  20. /**
  21. * WARNING: This call should be only used on platforms that don't
  22. * allow creating separate rendering thread. If it is called before
  23. * to bgfx_init, render thread won't be created by bgfx_init call.
  24. */
  25. BGFX_C_API bgfx_render_frame_t bgfx_render_frame();
  26. #if BX_PLATFORM_ANDROID
  27. # include <android/native_window.h>
  28. /**
  29. *
  30. */
  31. BGFX_C_API void bgfx_android_set_window(ANativeWindow* _window);
  32. #elif BX_PLATFORM_IOS
  33. /**
  34. *
  35. */
  36. BGFX_C_API void bgfx_ios_set_eagl_layer(void* _layer);
  37. #elif BX_PLATFORM_FREEBSD || BX_PLATFORM_LINUX || BX_PLATFORM_RPI
  38. # include <X11/Xlib.h>
  39. /**
  40. *
  41. */
  42. BGFX_C_API void bgfx_x11_set_display_window(Display* _display, Window _window);
  43. #elif BX_PLATFORM_NACL
  44. # include <ppapi/c/ppb_graphics_3d.h>
  45. # include <ppapi/c/ppb_instance.h>
  46. typedef void (*bgfx_post_swap_buffers_fn)(uint32_t _width, uint32_t _height);
  47. /**
  48. *
  49. */
  50. BGFX_C_API bool bgfx_nacl_set_interfaces(PP_Instance, const PPB_Instance*, const PPB_Graphics3D*, bgfx_post_swap_buffers_fn);
  51. #elif BX_PLATFORM_OSX
  52. /**
  53. *
  54. */
  55. BGFX_C_API void bgfx_osx_set_ns_window(void* _window);
  56. #elif BX_PLATFORM_WINDOWS
  57. # include <windows.h>
  58. /**
  59. *
  60. */
  61. BGFX_C_API void bgfx_win_set_hwnd(HWND _window);
  62. #endif // BX_PLATFORM_
  63. #endif // BGFX_PLATFORM_C99_H_HEADER_GUARD