Fixed IDL, added C++ IDL template.

This commit is contained in:
Бранимир Караџић
2024-11-12 20:19:52 -08:00
parent 4bc652939f
commit fe41532c40
13 changed files with 415 additions and 40 deletions

View File

@@ -2434,15 +2434,6 @@ public static class bgfx
[LinkName("bgfx_vertex_layout_decode")]
public static extern void vertex_layout_decode(VertexLayout* _this, Attrib _attrib, uint8 * _num, AttribType* _type, bool* _normalized, bool* _asInt);
/// <summary>
/// Returns `true` if VertexLayout contains attribute.
/// </summary>
///
/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
///
[LinkName("bgfx_vertex_layout_has")]
public static extern bool vertex_layout_has(VertexLayout* _this, Attrib _attrib);
/// <summary>
/// Skip `_num` bytes in vertex stream.
/// </summary>
@@ -3473,6 +3464,19 @@ public static class bgfx
[LinkName("bgfx_set_palette_color")]
public static extern void set_palette_color(uint8 _index, float _rgba);
/// <summary>
/// Set palette color value.
/// </summary>
///
/// <param name="_index">Index into palette.</param>
/// <param name="_r">Red value (RGBA floating point values)</param>
/// <param name="_g">Green value (RGBA floating point values)</param>
/// <param name="_b">Blue value (RGBA floating point values)</param>
/// <param name="_a">Alpha value (RGBA floating point values)</param>
///
[LinkName("bgfx_set_palette_color_rgba32f")]
public static extern void set_palette_color_rgba32f(uint8 _index, float _r, float _g, float _b, float _a);
/// <summary>
/// Set palette color value.
/// </summary>

View File

@@ -2385,16 +2385,6 @@ public static partial class bgfx
[DllImport(DllName, EntryPoint="bgfx_vertex_layout_decode", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void vertex_layout_decode(VertexLayout* _this, Attrib _attrib, byte * _num, AttribType* _type, bool* _normalized, bool* _asInt);
/// <summary>
/// Returns `true` if VertexLayout contains attribute.
/// </summary>
///
/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
///
[DllImport(DllName, EntryPoint="bgfx_vertex_layout_has", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern unsafe bool vertex_layout_has(VertexLayout* _this, Attrib _attrib);
/// <summary>
/// Skip `_num` bytes in vertex stream.
/// </summary>
@@ -3429,6 +3419,19 @@ public static partial class bgfx
[DllImport(DllName, EntryPoint="bgfx_set_palette_color", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_palette_color(byte _index, float _rgba);
/// <summary>
/// Set palette color value.
/// </summary>
///
/// <param name="_index">Index into palette.</param>
/// <param name="_r">Red value (RGBA floating point values)</param>
/// <param name="_g">Green value (RGBA floating point values)</param>
/// <param name="_b">Blue value (RGBA floating point values)</param>
/// <param name="_a">Alpha value (RGBA floating point values)</param>
///
[DllImport(DllName, EntryPoint="bgfx_set_palette_color_rgba32f", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_palette_color_rgba32f(byte _index, float _r, float _g, float _b, float _a);
/// <summary>
/// Set palette color value.
/// </summary>

View File

@@ -10,7 +10,7 @@ import bindbc.bgfx.config;
import bindbc.common.types: c_int64, c_uint64, va_list;
static import bgfx.fakeenum;
enum uint apiVersion = 128;
enum uint apiVersion = 129;
alias ViewID = ushort;
@@ -1105,6 +1105,12 @@ extern(C++, "bgfx") struct Init{
uint minResourceCBSize; ///Minimum resource command buffer size.
uint transientVBSize; ///Maximum transient vertex buffer size.
uint transientIBSize; ///Maximum transient index buffer size.
extern(D) mixin(joinFnBinds((){
FnBind[] ret = [
{q{void}, q{this}, q{}, ext: `C++`},
];
return ret;
}()));
}
/**
@@ -2503,7 +2509,7 @@ mixin(joinFnBinds((){
skip = Skip top level mips when parsing texture.
info = When non-`NULL` is specified it returns parsed texture information.
*/
{q{TextureHandle}, q{createTexture}, q{const(Memory)* mem, c_uint64 flags, ubyte skip=0, TextureInfo* info=null}, ext: `C++, "bgfx"`},
{q{TextureHandle}, q{createTexture}, q{const(Memory)* mem, c_uint64 flags=Texture.none|Sampler.none, ubyte skip=0, TextureInfo* info=null}, ext: `C++, "bgfx"`},
/**
* Create 2D texture.
@@ -2524,7 +2530,7 @@ mixin(joinFnBinds((){
`_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
1, expected memory layout is texture and all mips together for each array element.
*/
{q{TextureHandle}, q{createTexture2D}, q{ushort width, ushort height, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 flags, const(Memory)* mem=null}, ext: `C++, "bgfx"`},
{q{TextureHandle}, q{createTexture2D}, q{ushort width, ushort height, bool hasMIPs, ushort numLayers, bgfx.fakeenum.TextureFormat.Enum format, c_uint64 flags=Texture.none|Sampler.none, const(Memory)* mem=null}, ext: `C++, "bgfx"`},
/**
* Create texture with size based on back-buffer ratio. Texture will maintain ratio
@@ -2854,6 +2860,17 @@ mixin(joinFnBinds((){
*/
{q{void}, q{setPaletteColor}, q{ubyte index, const(float)* rgba}, ext: `C++, "bgfx"`},
/**
* Set palette color value.
Params:
index = Index into palette.
r = Red value (RGBA floating point values)
g = Green value (RGBA floating point values)
b = Blue value (RGBA floating point values)
a = Alpha value (RGBA floating point values)
*/
{q{void}, q{setPaletteColor}, q{ubyte index, float r, float g, float b, float a}, ext: `C++, "bgfx"`},
/**
* Set palette color value.
Params:
@@ -3568,7 +3585,7 @@ mixin(joinFnBinds((){
];
return ret;
}(), "Resolution, Init, Attachment, VertexLayout, Encoder, "));
}(), "Resolution, Limits, Init, Attachment, VertexLayout, Encoder, "));
static if(!staticBinding):
import bindbc.loader;

View File

@@ -1530,11 +1530,6 @@ pub const Init = extern struct {
pub inline fn decode(self: *const VertexLayout, _attrib: Attrib, _num: [*c]u8 , _type: [*c]AttribType, _normalized: [*c]bool, _asInt: [*c]bool) void {
return bgfx_vertex_layout_decode(self, _attrib, _num, _type, _normalized, _asInt);
}
/// Returns `true` if VertexLayout contains attribute.
/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
pub inline fn has(self: *const VertexLayout, _attrib: Attrib) bool {
return bgfx_vertex_layout_has(self, _attrib);
}
/// Skip `_num` bytes in vertex stream.
/// <param name="_num">Number of bytes to skip.</param>
pub inline fn skip(self: *VertexLayout, _num: u8) *VertexLayout {
@@ -1959,10 +1954,6 @@ extern fn bgfx_vertex_layout_add(self: [*c]VertexLayout, _attrib: Attrib, _num:
/// <param name="_asInt">Attribute is packed as int.</param>
extern fn bgfx_vertex_layout_decode(self: [*c]const VertexLayout, _attrib: Attrib, _num: [*c]u8 , _type: [*c]AttribType, _normalized: [*c]bool, _asInt: [*c]bool) void;
/// Returns `true` if VertexLayout contains attribute.
/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
extern fn bgfx_vertex_layout_has(self: [*c]const VertexLayout, _attrib: Attrib) bool;
/// Skip `_num` bytes in vertex stream.
/// <param name="_num">Number of bytes to skip.</param>
extern fn bgfx_vertex_layout_skip(self: [*c]VertexLayout, _num: u8) [*c]VertexLayout;
@@ -2794,6 +2785,17 @@ pub inline fn setPaletteColor(_index: u8, _rgba: [4]f32) void {
}
extern fn bgfx_set_palette_color(_index: u8, _rgba: [4]f32) void;
/// Set palette color value.
/// <param name="_index">Index into palette.</param>
/// <param name="_r">Red value (RGBA floating point values)</param>
/// <param name="_g">Green value (RGBA floating point values)</param>
/// <param name="_b">Blue value (RGBA floating point values)</param>
/// <param name="_a">Alpha value (RGBA floating point values)</param>
pub inline fn setPaletteColorRgba32f(_index: u8, _r: f32, _g: f32, _b: f32, _a: f32) void {
return bgfx_set_palette_color_rgba32f(_index, _r, _g, _b, _a);
}
extern fn bgfx_set_palette_color_rgba32f(_index: u8, _r: f32, _g: f32, _b: f32, _a: f32) void;
/// Set palette color value.
/// <param name="_index">Index into palette.</param>
/// <param name="_rgba">Packed 32-bit RGBA value.</param>