From 587518dc5edba2ff90d99344a7f553bf3140fe51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 13 Nov 2025 07:39:39 -0800 Subject: [PATCH] Fixed IDL. (#3495) --- bindings/bf/bgfx.bf | 51 ++++++++++++++--- bindings/c3/bgfx.c3 | 34 +++++++++--- bindings/cs/bgfx.cs | 51 ++++++++++++++--- bindings/d/package.d | 24 +++++--- bindings/zig/bgfx.zig | 35 +++++++++--- include/bgfx/c99/bgfx.h | 20 +++---- include/bgfx/defines.h | 18 +++--- scripts/bgfx.idl | 120 +++++++++++++++++++++------------------- 8 files changed, 231 insertions(+), 122 deletions(-) diff --git a/bindings/bf/bgfx.bf b/bindings/bf/bgfx.bf index 983a40125..d2e479831 100644 --- a/bindings/bf/bgfx.bf +++ b/bindings/bf/bgfx.bf @@ -613,47 +613,47 @@ public static class bgfx public enum BufferFlags : uint16 { /// - /// 1 8-bit value + /// 1 x 8-bit value /// ComputeFormat8x1 = 0x0001, /// - /// 2 8-bit values + /// 2 x 8-bit values /// ComputeFormat8x2 = 0x0002, /// - /// 4 8-bit values + /// 4 x 8-bit values /// ComputeFormat8x4 = 0x0003, /// - /// 1 16-bit value + /// 1 x 16-bit value /// ComputeFormat16x1 = 0x0004, /// - /// 2 16-bit values + /// 2 x 16-bit values /// ComputeFormat16x2 = 0x0005, /// - /// 4 16-bit values + /// 4 x 16-bit values /// ComputeFormat16x4 = 0x0006, /// - /// 1 32-bit value + /// 1 x 32-bit value /// ComputeFormat32x1 = 0x0007, /// - /// 2 32-bit values + /// 2 x 32-bit values /// ComputeFormat32x2 = 0x0008, /// - /// 4 32-bit values + /// 4 x 32-bit values /// ComputeFormat32x4 = 0x0009, ComputeFormatShift = 0, @@ -2055,12 +2055,39 @@ public static class bgfx [AllowDuplicates] public enum ShadingRate : uint32 { + /// + /// 1x1 + /// Rate1x1, + + /// + /// 1x2 + /// Rate1x2, + + /// + /// 2x1 + /// Rate2x1, + + /// + /// 2x2 + /// Rate2x2, + + /// + /// 2x4 + /// Rate2x4, + + /// + /// 4x2 + /// Rate4x2, + + /// + /// 4x4 + /// Rate4x4, Count @@ -3740,6 +3767,8 @@ public static class bgfx /// Reset all view settings to default. /// /// + /// _id View id. + /// [LinkName("bgfx_reset_view")] public static extern void reset_view(ViewId _id); @@ -4053,6 +4082,8 @@ public static class bgfx /// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. /// /// + /// Number of instances. + /// [LinkName("bgfx_encoder_set_instance_count")] public static extern void encoder_set_instance_count(Encoder* _this, uint32 _numInstances); @@ -4633,6 +4664,8 @@ public static class bgfx /// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. /// /// + /// Number of instances. + /// [LinkName("bgfx_set_instance_count")] public static extern void set_instance_count(uint32 _numInstances); diff --git a/bindings/c3/bgfx.c3 b/bindings/c3/bgfx.c3 index 2d1ccac08..e5959163d 100644 --- a/bindings/c3/bgfx.c3 +++ b/bindings/c3/bgfx.c3 @@ -385,31 +385,31 @@ enum DebugFlags : const uint enum BufferFlags : const ushort { - // 1 8-bit value + // 1 x 8-bit value COMPUTEFORMAT8X1 = 0x0001, - // 2 8-bit values + // 2 x 8-bit values COMPUTEFORMAT8X2 = 0x0002, - // 4 8-bit values + // 4 x 8-bit values COMPUTEFORMAT8X4 = 0x0003, - // 1 16-bit value + // 1 x 16-bit value COMPUTEFORMAT16X1 = 0x0004, - // 2 16-bit values + // 2 x 16-bit values COMPUTEFORMAT16X2 = 0x0005, - // 4 16-bit values + // 4 x 16-bit values COMPUTEFORMAT16X4 = 0x0006, - // 1 32-bit value + // 1 x 32-bit value COMPUTEFORMAT32X1 = 0x0007, - // 2 32-bit values + // 2 x 32-bit values COMPUTEFORMAT32X2 = 0x0008, - // 4 32-bit values + // 4 x 32-bit values COMPUTEFORMAT32X4 = 0x0009, COMPUTEFORMATSHIFT = 0, COMPUTEFORMATMASK = 0x000f, @@ -1325,12 +1325,25 @@ enum ViewMode : uint enum ShadingRate : uint { + // 1x1 RATE1X1, + + // 1x2 RATE1X2, + + // 2x1 RATE2X1, + + // 2x2 RATE2X2, + + // 2x4 RATE2X4, + + // 4x2 RATE4X2, + + // 4x4 RATE4X4, COUNT @@ -2643,6 +2656,7 @@ extern fn void set_view_order(ushort _id, ushort _num, ushort* _order) @extern(" extern fn void set_view_shading_rate(ushort _id, ShadingRate _shadingRate) @extern("bgfx_set_view_shading_rate"); // Reset all view settings to default. +// _id : `_id View id.` extern fn void reset_view(ushort _id) @extern("bgfx_reset_view"); // Begin submitting draw calls from thread. @@ -2821,6 +2835,7 @@ extern fn void encoder_set_instance_data_from_dynamic_vertex_buffer(Encoder* _th // Set number of instances for auto generated instances use in conjunction // with gl_InstanceID. // @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. +// _numInstances : `Number of instances.` extern fn void encoder_set_instance_count(Encoder* _this, uint _numInstances) @extern("bgfx_encoder_set_instance_count"); // Set texture stage for draw primitive. @@ -3173,6 +3188,7 @@ extern fn void set_instance_data_from_dynamic_vertex_buffer(DynamicVertexBufferH // Set number of instances for auto generated instances use in conjunction // with gl_InstanceID. // @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. +// _numInstances : `Number of instances.` extern fn void set_instance_count(uint _numInstances) @extern("bgfx_set_instance_count"); // Set texture stage for draw primitive. diff --git a/bindings/cs/bgfx.cs b/bindings/cs/bgfx.cs index cfd86ef68..20cf52f21 100644 --- a/bindings/cs/bgfx.cs +++ b/bindings/cs/bgfx.cs @@ -612,47 +612,47 @@ public static partial class bgfx public enum BufferFlags : ushort { /// - /// 1 8-bit value + /// 1 x 8-bit value /// ComputeFormat8x1 = 0x0001, /// - /// 2 8-bit values + /// 2 x 8-bit values /// ComputeFormat8x2 = 0x0002, /// - /// 4 8-bit values + /// 4 x 8-bit values /// ComputeFormat8x4 = 0x0003, /// - /// 1 16-bit value + /// 1 x 16-bit value /// ComputeFormat16x1 = 0x0004, /// - /// 2 16-bit values + /// 2 x 16-bit values /// ComputeFormat16x2 = 0x0005, /// - /// 4 16-bit values + /// 4 x 16-bit values /// ComputeFormat16x4 = 0x0006, /// - /// 1 32-bit value + /// 1 x 32-bit value /// ComputeFormat32x1 = 0x0007, /// - /// 2 32-bit values + /// 2 x 32-bit values /// ComputeFormat32x2 = 0x0008, /// - /// 4 32-bit values + /// 4 x 32-bit values /// ComputeFormat32x4 = 0x0009, ComputeFormatShift = 0, @@ -2039,12 +2039,39 @@ public static partial class bgfx public enum ShadingRate { + /// + /// 1x1 + /// Rate1x1, + + /// + /// 1x2 + /// Rate1x2, + + /// + /// 2x1 + /// Rate2x1, + + /// + /// 2x2 + /// Rate2x2, + + /// + /// 2x4 + /// Rate2x4, + + /// + /// 4x2 + /// Rate4x2, + + /// + /// 4x4 + /// Rate4x4, Count @@ -3693,6 +3720,8 @@ public static partial class bgfx /// Reset all view settings to default. /// /// + /// _id View id. + /// [DllImport(DllName, EntryPoint="bgfx_reset_view", CallingConvention = CallingConvention.Cdecl)] public static extern unsafe void reset_view(ushort _id); @@ -4006,6 +4035,8 @@ public static partial class bgfx /// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. /// /// + /// Number of instances. + /// [DllImport(DllName, EntryPoint="bgfx_encoder_set_instance_count", CallingConvention = CallingConvention.Cdecl)] public static extern unsafe void encoder_set_instance_count(Encoder* _this, uint _numInstances); @@ -4586,6 +4617,8 @@ public static partial class bgfx /// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. /// /// + /// Number of instances. + /// [DllImport(DllName, EntryPoint="bgfx_set_instance_count", CallingConvention = CallingConvention.Cdecl)] public static extern unsafe void set_instance_count(uint _numInstances); diff --git a/bindings/d/package.d b/bindings/d/package.d index 41b13aa85..5f09ad167 100644 --- a/bindings/d/package.d +++ b/bindings/d/package.d @@ -294,15 +294,15 @@ enum Debug: Debug_{ alias BufferComputeFormat_ = ushort; enum BufferComputeFormat: BufferComputeFormat_{ - _8x1 = 0x0001, ///1 8-bit value - _8x2 = 0x0002, ///2 8-bit values - _8x4 = 0x0003, ///4 8-bit values - _16x1 = 0x0004, ///1 16-bit value - _16x2 = 0x0005, ///2 16-bit values - _16x4 = 0x0006, ///4 16-bit values - _32x1 = 0x0007, ///1 32-bit value - _32x2 = 0x0008, ///2 32-bit values - _32x4 = 0x0009, ///4 32-bit values + _8x1 = 0x0001, ///1 x 8-bit value + _8x2 = 0x0002, ///2 x 8-bit values + _8x4 = 0x0003, ///4 x 8-bit values + _16x1 = 0x0004, ///1 x 16-bit value + _16x2 = 0x0005, ///2 x 16-bit values + _16x4 = 0x0006, ///4 x 16-bit values + _32x1 = 0x0007, ///1 x 32-bit value + _32x2 = 0x0008, ///2 x 32-bit values + _32x4 = 0x0009, ///4 x 32-bit values shift = 0, mask = 0x000F, } @@ -1703,6 +1703,8 @@ extern(C++, "bgfx") struct Encoder{ Set number of instances for auto generated instances use in conjunction with gl_InstanceID. Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`. + Params: + numInstances = Number of instances. */ {q{void}, q{setInstanceCount}, q{uint numInstances}, ext: `C++`}, @@ -3093,6 +3095,8 @@ mixin(joinFnBinds((){ /** * Reset all view settings to default. + Params: + id = _id View id. */ {q{void}, q{resetView}, q{ViewID id}, ext: `C++, "bgfx"`}, @@ -3480,6 +3484,8 @@ mixin(joinFnBinds((){ * Set number of instances for auto generated instances use in conjunction * with gl_InstanceID. * Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`. + Params: + numInstances = Number of instances. */ {q{void}, q{setInstanceCount}, q{uint numInstances}, ext: `C++, "bgfx"`}, diff --git a/bindings/zig/bgfx.zig b/bindings/zig/bgfx.zig index 95933f7d6..b518b4fd4 100644 --- a/bindings/zig/bgfx.zig +++ b/bindings/zig/bgfx.zig @@ -375,31 +375,31 @@ pub const DebugFlags_Text: DebugFlags = 0x00000008; pub const DebugFlags_Profiler: DebugFlags = 0x00000010; pub const BufferFlags = u16; -/// 1 8-bit value +/// 1 x 8-bit value pub const BufferFlags_ComputeFormat8x1: BufferFlags = 0x0001; -/// 2 8-bit values +/// 2 x 8-bit values pub const BufferFlags_ComputeFormat8x2: BufferFlags = 0x0002; -/// 4 8-bit values +/// 4 x 8-bit values pub const BufferFlags_ComputeFormat8x4: BufferFlags = 0x0003; -/// 1 16-bit value +/// 1 x 16-bit value pub const BufferFlags_ComputeFormat16x1: BufferFlags = 0x0004; -/// 2 16-bit values +/// 2 x 16-bit values pub const BufferFlags_ComputeFormat16x2: BufferFlags = 0x0005; -/// 4 16-bit values +/// 4 x 16-bit values pub const BufferFlags_ComputeFormat16x4: BufferFlags = 0x0006; -/// 1 32-bit value +/// 1 x 32-bit value pub const BufferFlags_ComputeFormat32x1: BufferFlags = 0x0007; -/// 2 32-bit values +/// 2 x 32-bit values pub const BufferFlags_ComputeFormat32x2: BufferFlags = 0x0008; -/// 4 32-bit values +/// 4 x 32-bit values pub const BufferFlags_ComputeFormat32x4: BufferFlags = 0x0009; pub const BufferFlags_ComputeFormatShift: BufferFlags = 0; pub const BufferFlags_ComputeFormatMask: BufferFlags = 0x000f; @@ -1283,12 +1283,25 @@ pub const ViewMode = enum(c_int) { }; pub const ShadingRate = enum(c_int) { + /// 1x1 Rate1x1, + + /// 1x2 Rate1x2, + + /// 2x1 Rate2x1, + + /// 2x2 Rate2x2, + + /// 2x4 Rate2x4, + + /// 4x2 Rate4x2, + + /// 4x4 Rate4x4, Count @@ -1761,6 +1774,7 @@ pub const Init = extern struct { /// Set number of instances for auto generated instances use in conjunction /// with gl_InstanceID. /// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. + /// Number of instances. pub inline fn setInstanceCount(self: ?*Encoder, _numInstances: u32) void { return bgfx_encoder_set_instance_count(self, _numInstances); } @@ -3010,6 +3024,7 @@ pub inline fn setViewShadingRate(_id: ViewId, _shadingRate: ShadingRate) void { extern fn bgfx_set_view_shading_rate(_id: ViewId, _shadingRate: ShadingRate) void; /// Reset all view settings to default. +/// _id View id. pub inline fn resetView(_id: ViewId) void { return bgfx_reset_view(_id); } @@ -3203,6 +3218,7 @@ extern fn bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(self: ?*Enco /// Set number of instances for auto generated instances use in conjunction /// with gl_InstanceID. /// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. +/// Number of instances. extern fn bgfx_encoder_set_instance_count(self: ?*Encoder, _numInstances: u32) void; /// Set texture stage for draw primitive. @@ -3642,6 +3658,7 @@ extern fn bgfx_set_instance_data_from_dynamic_vertex_buffer(_handle: DynamicVert /// Set number of instances for auto generated instances use in conjunction /// with gl_InstanceID. /// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. +/// Number of instances. pub inline fn setInstanceCount(_numInstances: u32) void { return bgfx_set_instance_count(_numInstances); } diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h index 585407afa..d485ce3d5 100644 --- a/include/bgfx/c99/bgfx.h +++ b/include/bgfx/c99/bgfx.h @@ -413,13 +413,13 @@ typedef enum bgfx_view_mode */ typedef enum bgfx_shading_rate { - BGFX_SHADING_RATE_RATE_1X_1, /** ( 0) */ - BGFX_SHADING_RATE_RATE_1X_2, /** ( 1) */ - BGFX_SHADING_RATE_RATE_2X_1, /** ( 2) */ - BGFX_SHADING_RATE_RATE_2X_2, /** ( 3) */ - BGFX_SHADING_RATE_RATE_2X_4, /** ( 4) */ - BGFX_SHADING_RATE_RATE_4X_2, /** ( 5) */ - BGFX_SHADING_RATE_RATE_4X_4, /** ( 6) */ + BGFX_SHADING_RATE_RATE_1X_1, /** ( 0) 1x1 */ + BGFX_SHADING_RATE_RATE_1X_2, /** ( 1) 1x2 */ + BGFX_SHADING_RATE_RATE_2X_1, /** ( 2) 2x1 */ + BGFX_SHADING_RATE_RATE_2X_2, /** ( 3) 2x2 */ + BGFX_SHADING_RATE_RATE_2X_4, /** ( 4) 2x4 */ + BGFX_SHADING_RATE_RATE_4X_2, /** ( 5) 4x2 */ + BGFX_SHADING_RATE_RATE_4X_4, /** ( 6) 4x4 */ BGFX_SHADING_RATE_COUNT @@ -2476,7 +2476,7 @@ BGFX_C_API void bgfx_set_view_shading_rate(bgfx_view_id_t _id, bgfx_shading_rate /** * Reset all view settings to default. * - * @param[in] _id + * @param[in] _id _id View id. * */ BGFX_C_API void bgfx_reset_view(bgfx_view_id_t _id); @@ -2789,7 +2789,7 @@ BGFX_C_API void bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(bgfx_e * with gl_InstanceID. * @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. * - * @param[in] _numInstances + * @param[in] _numInstances Number of instances. * */ BGFX_C_API void bgfx_encoder_set_instance_count(bgfx_encoder_t* _this, uint32_t _numInstances); @@ -3375,7 +3375,7 @@ BGFX_C_API void bgfx_set_instance_data_from_dynamic_vertex_buffer(bgfx_dynamic_v * with gl_InstanceID. * @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`. * - * @param[in] _numInstances + * @param[in] _numInstances Number of instances. * */ BGFX_C_API void bgfx_set_instance_count(uint32_t _numInstances); diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index 923c27301..45c4cedd5 100644 --- a/include/bgfx/defines.h +++ b/include/bgfx/defines.h @@ -277,15 +277,15 @@ #define BGFX_DEBUG_TEXT UINT32_C(0x00000008) //!< Enable debug text display. #define BGFX_DEBUG_PROFILER UINT32_C(0x00000010) //!< Enable profiler. This causes per-view statistics to be collected, available through `bgfx::Stats::ViewStats`. This is unrelated to the profiler functions in `bgfx::CallbackI`. -#define BGFX_BUFFER_COMPUTE_FORMAT_8X1 UINT16_C(0x0001) //!< 1 8-bit value -#define BGFX_BUFFER_COMPUTE_FORMAT_8X2 UINT16_C(0x0002) //!< 2 8-bit values -#define BGFX_BUFFER_COMPUTE_FORMAT_8X4 UINT16_C(0x0003) //!< 4 8-bit values -#define BGFX_BUFFER_COMPUTE_FORMAT_16X1 UINT16_C(0x0004) //!< 1 16-bit value -#define BGFX_BUFFER_COMPUTE_FORMAT_16X2 UINT16_C(0x0005) //!< 2 16-bit values -#define BGFX_BUFFER_COMPUTE_FORMAT_16X4 UINT16_C(0x0006) //!< 4 16-bit values -#define BGFX_BUFFER_COMPUTE_FORMAT_32X1 UINT16_C(0x0007) //!< 1 32-bit value -#define BGFX_BUFFER_COMPUTE_FORMAT_32X2 UINT16_C(0x0008) //!< 2 32-bit values -#define BGFX_BUFFER_COMPUTE_FORMAT_32X4 UINT16_C(0x0009) //!< 4 32-bit values +#define BGFX_BUFFER_COMPUTE_FORMAT_8X1 UINT16_C(0x0001) //!< 1 x 8-bit value +#define BGFX_BUFFER_COMPUTE_FORMAT_8X2 UINT16_C(0x0002) //!< 2 x 8-bit values +#define BGFX_BUFFER_COMPUTE_FORMAT_8X4 UINT16_C(0x0003) //!< 4 x 8-bit values +#define BGFX_BUFFER_COMPUTE_FORMAT_16X1 UINT16_C(0x0004) //!< 1 x 16-bit value +#define BGFX_BUFFER_COMPUTE_FORMAT_16X2 UINT16_C(0x0005) //!< 2 x 16-bit values +#define BGFX_BUFFER_COMPUTE_FORMAT_16X4 UINT16_C(0x0006) //!< 4 x 16-bit values +#define BGFX_BUFFER_COMPUTE_FORMAT_32X1 UINT16_C(0x0007) //!< 1 x 32-bit value +#define BGFX_BUFFER_COMPUTE_FORMAT_32X2 UINT16_C(0x0008) //!< 2 x 32-bit values +#define BGFX_BUFFER_COMPUTE_FORMAT_32X4 UINT16_C(0x0009) //!< 4 x 32-bit values #define BGFX_BUFFER_COMPUTE_FORMAT_SHIFT 0 #define BGFX_BUFFER_COMPUTE_FORMAT_MASK UINT16_C(0x000f) diff --git a/scripts/bgfx.idl b/scripts/bgfx.idl index c8212c5ed..4958d009d 100644 --- a/scripts/bgfx.idl +++ b/scripts/bgfx.idl @@ -223,15 +223,15 @@ flag.Debug { bits = 32 } () flag.BufferComputeFormat { bits = 16, shift = 0, range = 4, base = 1 } - ._8x1 --- 1 8-bit value - ._8x2 --- 2 8-bit values - ._8x4 --- 4 8-bit values - ._16x1 --- 1 16-bit value - ._16x2 --- 2 16-bit values - ._16x4 --- 4 16-bit values - ._32x1 --- 1 32-bit value - ._32x2 --- 2 32-bit values - ._32x4 --- 4 32-bit values + ._8x1 --- 1 x 8-bit value + ._8x2 --- 2 x 8-bit values + ._8x4 --- 4 x 8-bit values + ._16x1 --- 1 x 16-bit value + ._16x2 --- 2 x 16-bit values + ._16x4 --- 4 x 16-bit values + ._32x1 --- 1 x 32-bit value + ._32x2 --- 2 x 32-bit values + ._32x4 --- 4 x 32-bit values () flag.BufferComputeType { bits = 16, shift = 4, range = 2, base = 1 } @@ -703,19 +703,19 @@ enum.ViewMode { underscore, comment = "View modes:" } --- Shading Rate. enum.ShadingRate { underscore, comment = "Shading rate:" } - .Rate1x1 - .Rate1x2 - .Rate2x1 - .Rate2x2 - .Rate2x4 - .Rate4x2 - .Rate4x4 + .Rate1x1 --- 1x1 + .Rate1x2 --- 1x2 + .Rate2x1 --- 2x1 + .Rate2x2 --- 2x2 + .Rate2x4 --- 2x4 + .Rate4x2 --- 4x2 + .Rate4x4 --- 4x4 () --- Native window handle type. enum.NativeWindowHandleType { underscore, comment = "Native Window handle type:" } - .Default --- Platform default handle type (X11 on Linux). - .Wayland --- Wayland. + .Default --- Platform default handle type (X11 on Linux). + .Wayland --- Wayland. () --- Render frame enum. @@ -803,16 +803,20 @@ struct.InternalData --- Platform data. struct.PlatformData { ctor } - .ndt "void*" --- Native display type (*nix specific). - .nwh "void*" --- Native window handle. If `NULL`, bgfx will create a headless - --- context/device, provided the rendering API supports it. - .context "void*" --- GL context, D3D device, or Vulkan device. If `NULL`, bgfx - --- will create context/device. - .backBuffer "void*" --- GL back-buffer, or D3D render target view. If `NULL` bgfx will - --- create back-buffer color surface. - .backBufferDS "void*" --- Backbuffer depth/stencil. If `NULL`, bgfx will create a back-buffer - --- depth/stencil surface. - .type "NativeWindowHandleType::Enum" --- Handle type. Needed for platforms having more than one option. + .ndt "void*" --- Native display type (*nix specific). + .nwh "void*" + --- Native window handle. If `NULL`, bgfx will create a headless + --- context/device, provided the rendering API supports it. + .context "void*" + --- GL context, D3D device, or Vulkan device. If `NULL`, bgfx + --- will create context/device. + .backBuffer "void*" + --- GL back-buffer, or D3D render target view. If `NULL` bgfx will + --- create back-buffer color surface. + .backBufferDS "void*" + --- Backbuffer depth/stencil. If `NULL`, bgfx will create a back-buffer + --- depth/stencil surface. + .type "NativeWindowHandleType::Enum" --- Handle type. Needed for platforms having more than one option. --- Backbuffer resolution and reset parameters. struct.Resolution { ctor } @@ -835,34 +839,34 @@ struct.Limits { ctor, namespace = "Init" } --- Initialization parameters used by `bgfx::init`. struct.Init { ctor } - .type "RendererType::Enum" --- Select rendering backend. When set to RendererType::Count - --- a default rendering backend will be selected appropriate to the platform. - --- See: `bgfx::RendererType` + .type "RendererType::Enum" --- Select rendering backend. When set to RendererType::Count + --- a default rendering backend will be selected appropriate to the platform. + --- See: `bgfx::RendererType` - .vendorId "uint16_t" --- Vendor PCI ID. If set to `BGFX_PCI_ID_NONE`, discrete and integrated - --- GPUs will be prioritised. - --- - `BGFX_PCI_ID_NONE` - Autoselect adapter. - --- - `BGFX_PCI_ID_SOFTWARE_RASTERIZER` - Software rasterizer. - --- - `BGFX_PCI_ID_AMD` - AMD adapter. - --- - `BGFX_PCI_ID_APPLE` - Apple adapter. - --- - `BGFX_PCI_ID_INTEL` - Intel adapter. - --- - `BGFX_PCI_ID_NVIDIA` - NVIDIA adapter. - --- - `BGFX_PCI_ID_MICROSOFT` - Microsoft adapter. + .vendorId "uint16_t" --- Vendor PCI ID. If set to `BGFX_PCI_ID_NONE`, discrete and integrated + --- GPUs will be prioritised. + --- - `BGFX_PCI_ID_NONE` - Autoselect adapter. + --- - `BGFX_PCI_ID_SOFTWARE_RASTERIZER` - Software rasterizer. + --- - `BGFX_PCI_ID_AMD` - AMD adapter. + --- - `BGFX_PCI_ID_APPLE` - Apple adapter. + --- - `BGFX_PCI_ID_INTEL` - Intel adapter. + --- - `BGFX_PCI_ID_NVIDIA` - NVIDIA adapter. + --- - `BGFX_PCI_ID_MICROSOFT` - Microsoft adapter. - .deviceId "uint16_t" --- Device ID. If set to 0 it will select first device, or device with - --- matching ID. - .capabilities "uint64_t" --- Capabilities initialization mask (default: UINT64_MAX). - .debug "bool" --- Enable device for debugging. - .profile "bool" --- Enable device for profiling. - .platformData "PlatformData" --- Platform data. - .resolution "Resolution" --- Backbuffer resolution and reset parameters. See: `bgfx::Resolution`. - .limits "Limits" --- Configurable runtime limits parameters. - .callback "CallbackI*" --- Provide application specific callback interface. - --- See: `bgfx::CallbackI` + .deviceId "uint16_t" --- Device ID. If set to 0 it will select first device, or device with + --- matching ID. + .capabilities "uint64_t" --- Capabilities initialization mask (default: UINT64_MAX). + .debug "bool" --- Enable device for debugging. + .profile "bool" --- Enable device for profiling. + .platformData "PlatformData" --- Platform data. + .resolution "Resolution" --- Backbuffer resolution and reset parameters. See: `bgfx::Resolution`. + .limits "Limits" --- Configurable runtime limits parameters. + .callback "CallbackI*" --- Provide application specific callback interface. + --- See: `bgfx::CallbackI` - .allocator "bx::AllocatorI*" --- Custom allocator. When a custom allocator is not - --- specified, bgfx uses the CRT allocator. Bgfx assumes - --- custom allocator is thread safe. + .allocator "bx::AllocatorI*" --- Custom allocator. When a custom allocator is not + --- specified, bgfx uses the CRT allocator. Bgfx assumes + --- custom allocator is thread safe. --- Memory must be obtained by calling `bgfx::alloc`, `bgfx::copy`, or `bgfx::makeRef`. --- @@ -999,7 +1003,7 @@ struct.Stats .transientVbUsed "int32_t" --- Amount of transient vertex buffer used. .transientIbUsed "int32_t" --- Amount of transient index buffer used. - .numPrims "uint32_t[Topology::Count]" --- Number of primitives rendered. + .numPrims "uint32_t[Topology::Count]" --- Number of primitives rendered. .gpuMemoryMax "int64_t" --- Maximum available GPU memory for application. .gpuMemoryUsed "int64_t" --- Amount of GPU memory used by the application. @@ -1256,7 +1260,7 @@ func.getCaps --- @attention Pointer returned is valid until `bgfx::frame` is called. --- func.getStats - "const Stats*" -- Performance counters. + "const Stats*" --- Performance counters. --- Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx. func.alloc @@ -2221,7 +2225,7 @@ func.setViewShadingRate --- Reset all view settings to default. func.resetView "void" - .id "ViewId" -- _id View id. + .id "ViewId" --- _id View id. --- Begin submitting draw calls from thread. func.begin { cname = "encoder_begin" } @@ -2520,7 +2524,7 @@ func.Encoder.setInstanceDataBuffer { cname = "set_instance_data_from_dynamic_ver --- func.Encoder.setInstanceCount "void" - .numInstances "uint32_t" -- Number of instances. + .numInstances "uint32_t" --- Number of instances. --- Set texture stage for draw primitive. func.Encoder.setTexture @@ -3096,7 +3100,7 @@ func.setInstanceDataBuffer { cname = "set_instance_data_from_dynamic_vertex_buff --- func.setInstanceCount "void" - .numInstances "uint32_t" -- Number of instances. + .numInstances "uint32_t" --- Number of instances. --- Set texture stage for draw primitive. func.setTexture