temp.bgfx.idl.inl 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
  3. */
  4. /*
  5. *
  6. * AUTO GENERATED! DO NOT EDIT!
  7. *
  8. */
  9. $c99
  10. /* user define functions */
  11. BGFX_C_API void bgfx_init_ctor(bgfx_init_t* _init)
  12. {
  13. BX_PLACEMENT_NEW(_init, bgfx::Init);
  14. }
  15. BGFX_C_API bool bgfx_init(const bgfx_init_t * _init)
  16. {
  17. bgfx_init_t init =*_init;
  18. if (init.callback != NULL)
  19. {
  20. static bgfx::CallbackC99 s_callback;
  21. s_callback.m_interface = init.callback;
  22. init.callback = reinterpret_cast<bgfx_callback_interface_t*>(&s_callback);
  23. }
  24. if (init.allocator != NULL)
  25. {
  26. static bgfx::AllocatorC99 s_allocator;
  27. s_allocator.m_interface = init.allocator;
  28. init.allocator = reinterpret_cast<bgfx_allocator_interface_t*>(&s_allocator);
  29. }
  30. union { const bgfx_init_t* c; const bgfx::Init* cpp; } in;
  31. in.c = &init;
  32. return bgfx::init(*in.cpp);
  33. }
  34. /**/
  35. BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
  36. {
  37. if (_version == BGFX_API_VERSION)
  38. {
  39. static bgfx_interface_vtbl_t s_bgfx_interface =
  40. {
  41. $interface_import
  42. };
  43. return &s_bgfx_interface;
  44. }
  45. return NULL;
  46. }