Add example variants.json that adds IntPtr* as a parameter variant for ImFontAtlas_GetTexDataAsAlpha8 and ImFontAtlas_GetTexDataAsRGBA32.

Rerun code generation.
internals
giawa 6 years ago
parent cd5c0269b0
commit 5afed427ad
  1. 7
      src/CodeGenerator/CodeGenerator.csproj
  2. 16
      src/CodeGenerator/variants.json
  3. 60
      src/ImGui.NET/Generated/ImFontAtlas.gen.cs
  4. 4
      src/ImGui.NET/Generated/ImGuiNative.gen.cs

@ -5,9 +5,16 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="variants.json" />
</ItemGroup>
<ItemGroup>
<Content Include="structs_and_enums.json" CopyToOutputDirectory="PreserveNewest" />
<Content Include="definitions.json" CopyToOutputDirectory="PreserveNewest" />
<Content Include="variants.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>

@ -0,0 +1,16 @@
{
"ImFontAtlas_GetTexDataAsAlpha8": [
{
"name": "out_pixels",
"type": "unsigned char**",
"variants": [ "IntPtr*" ]
}
],
"ImFontAtlas_GetTexDataAsRGBA32": [
{
"name": "out_pixels",
"type": "unsigned char**",
"variants": [ "IntPtr*" ]
}
]
}

@ -434,6 +434,36 @@ namespace ImGuiNET
}
}
}
public void GetTexDataAsAlpha8(out IntPtr out_pixels, out int out_width, out int out_height)
{
int* out_bytes_per_pixel = null;
fixed (IntPtr* native_out_pixels = &out_pixels)
{
fixed (int* native_out_width = &out_width)
{
fixed (int* native_out_height = &out_height)
{
ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, native_out_pixels, native_out_width, native_out_height, out_bytes_per_pixel);
}
}
}
}
public void GetTexDataAsAlpha8(out IntPtr out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel)
{
fixed (IntPtr* native_out_pixels = &out_pixels)
{
fixed (int* native_out_width = &out_width)
{
fixed (int* native_out_height = &out_height)
{
fixed (int* native_out_bytes_per_pixel = &out_bytes_per_pixel)
{
ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, native_out_pixels, native_out_width, native_out_height, native_out_bytes_per_pixel);
}
}
}
}
}
public void GetTexDataAsRGBA32(out byte* out_pixels, out int out_width, out int out_height)
{
int* out_bytes_per_pixel = null;
@ -464,6 +494,36 @@ namespace ImGuiNET
}
}
}
public void GetTexDataAsRGBA32(out IntPtr out_pixels, out int out_width, out int out_height)
{
int* out_bytes_per_pixel = null;
fixed (IntPtr* native_out_pixels = &out_pixels)
{
fixed (int* native_out_width = &out_width)
{
fixed (int* native_out_height = &out_height)
{
ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, native_out_pixels, native_out_width, native_out_height, out_bytes_per_pixel);
}
}
}
}
public void GetTexDataAsRGBA32(out IntPtr out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel)
{
fixed (IntPtr* native_out_pixels = &out_pixels)
{
fixed (int* native_out_width = &out_width)
{
fixed (int* native_out_height = &out_height)
{
fixed (int* native_out_bytes_per_pixel = &out_bytes_per_pixel)
{
ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, native_out_pixels, native_out_width, native_out_height, native_out_bytes_per_pixel);
}
}
}
}
}
public bool IsBuilt()
{
byte ret = ImGuiNative.ImFontAtlas_IsBuilt(NativePtr);

@ -895,8 +895,12 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFontAtlas_GetTexDataAsAlpha8(ImFontAtlas* self, byte** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFontAtlas_GetTexDataAsAlpha8(ImFontAtlas* self, IntPtr* out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFontAtlas_GetTexDataAsRGBA32(ImFontAtlas* self, byte** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFontAtlas_GetTexDataAsRGBA32(ImFontAtlas* self, IntPtr* out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern ImFontAtlas* ImFontAtlas_ImFontAtlas();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte ImFontAtlas_IsBuilt(ImFontAtlas* self);

Loading…
Cancel
Save