temp.bgfx.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * Copyright 2011-2025 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
  4. */
  5. /*
  6. *
  7. * AUTO GENERATED FROM IDL! DO NOT EDIT! (source : $source)
  8. *
  9. * More info about IDL:
  10. * https://gist.github.com/bkaradzic/05a1c86a6dd57bf86e2d828878e88dc2#bgfx-is-switching-to-idl-to-generate-api
  11. *
  12. */
  13. #ifndef BGFX_C99_H_HEADER_GUARD
  14. #define BGFX_C99_H_HEADER_GUARD
  15. #include <stdarg.h> // va_list
  16. #include <stdbool.h> // bool
  17. #include <stdint.h> // uint32_t
  18. #include <stdlib.h> // size_t
  19. #include <bx/platform.h>
  20. #if !defined(BGFX_INVALID_HANDLE)
  21. # define BGFX_INVALID_HANDLE { UINT16_MAX }
  22. #endif // !defined(BGFX_INVALID_HANDLE)
  23. #ifndef BGFX_SHARED_LIB_BUILD
  24. # define BGFX_SHARED_LIB_BUILD 0
  25. #endif // BGFX_SHARED_LIB_BUILD
  26. #ifndef BGFX_SHARED_LIB_USE
  27. # define BGFX_SHARED_LIB_USE 0
  28. #endif // BGFX_SHARED_LIB_USE
  29. #if BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
  30. # define BGFX_SYMBOL_EXPORT __declspec(dllexport)
  31. # define BGFX_SYMBOL_IMPORT __declspec(dllimport)
  32. #else
  33. # define BGFX_SYMBOL_EXPORT __attribute__((visibility("default")))
  34. # define BGFX_SYMBOL_IMPORT
  35. #endif // BX_PLATFORM_WINDOWS
  36. #if BGFX_SHARED_LIB_BUILD
  37. # define BGFX_SHARED_LIB_API BGFX_SYMBOL_EXPORT
  38. #elif BGFX_SHARED_LIB_USE
  39. # define BGFX_SHARED_LIB_API BGFX_SYMBOL_IMPORT
  40. #else
  41. # define BGFX_SHARED_LIB_API
  42. #endif // BGFX_SHARED_LIB_*
  43. #if defined(__cplusplus)
  44. # define BGFX_C_API extern "C" BGFX_SHARED_LIB_API
  45. #else
  46. # define BGFX_C_API BGFX_SHARED_LIB_API
  47. #endif // defined(__cplusplus)
  48. #include "../defines.h"
  49. $cenums
  50. /**/
  51. typedef uint16_t bgfx_view_id_t;
  52. /**/
  53. typedef struct bgfx_allocator_interface_s
  54. {
  55. const struct bgfx_allocator_vtbl_s* vtbl;
  56. } bgfx_allocator_interface_t;
  57. /**/
  58. typedef struct bgfx_allocator_vtbl_s
  59. {
  60. void* (*realloc)(bgfx_allocator_interface_t* _this, void* _ptr, size_t _size, size_t _align, const char* _file, uint32_t _line);
  61. } bgfx_allocator_vtbl_t;
  62. /**/
  63. typedef struct bgfx_interface_vtbl bgfx_interface_vtbl_t;
  64. /**/
  65. typedef struct bgfx_callback_interface_s
  66. {
  67. const struct bgfx_callback_vtbl_s* vtbl;
  68. } bgfx_callback_interface_t;
  69. /**/
  70. typedef struct bgfx_callback_vtbl_s
  71. {
  72. void (*fatal)(bgfx_callback_interface_t* _this, const char* _filePath, uint16_t _line, bgfx_fatal_t _code, const char* _str);
  73. void (*trace_vargs)(bgfx_callback_interface_t* _this, const char* _filePath, uint16_t _line, const char* _format, va_list _argList);
  74. void (*profiler_begin)(bgfx_callback_interface_t* _this, const char* _name, uint32_t _abgr, const char* _filePath, uint16_t _line);
  75. void (*profiler_begin_literal)(bgfx_callback_interface_t* _this, const char* _name, uint32_t _abgr, const char* _filePath, uint16_t _line);
  76. void (*profiler_end)(bgfx_callback_interface_t* _this);
  77. uint32_t (*cache_read_size)(bgfx_callback_interface_t* _this, uint64_t _id);
  78. bool (*cache_read)(bgfx_callback_interface_t* _this, uint64_t _id, void* _data, uint32_t _size);
  79. void (*cache_write)(bgfx_callback_interface_t* _this, uint64_t _id, const void* _data, uint32_t _size);
  80. void (*screen_shot)(bgfx_callback_interface_t* _this, const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void* _data, uint32_t _size, bool _yflip);
  81. void (*capture_begin)(bgfx_callback_interface_t* _this, uint32_t _width, uint32_t _height, uint32_t _pitch, bgfx_texture_format_t _format, bool _yflip);
  82. void (*capture_end)(bgfx_callback_interface_t* _this);
  83. void (*capture_frame)(bgfx_callback_interface_t* _this, const void* _data, uint32_t _size);
  84. } bgfx_callback_vtbl_t;
  85. $chandles
  86. #define BGFX_HANDLE_IS_VALID(h) ((h).idx != UINT16_MAX)
  87. $cfuncptrs
  88. $cstructs
  89. $c99decl
  90. /**/
  91. typedef enum bgfx_function_id
  92. {
  93. $c99_functionid
  94. BGFX_FUNCTION_ID_COUNT
  95. } bgfx_function_id_t;
  96. /**/
  97. struct bgfx_interface_vtbl
  98. {
  99. $interface_struct
  100. };
  101. /**/
  102. typedef bgfx_interface_vtbl_t* (*PFN_BGFX_GET_INTERFACE)(uint32_t _version);
  103. /**/
  104. BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version);
  105. #endif // BGFX_C99_H_HEADER_GUARD