Modify SampleProgram to use 'safe' version of GetTexDataAsRGBA32, which was auto-generated by the CodeGenerator with the new variant functionality.

internals
giawa 5 years ago
parent 5afed427ad
commit 8be7644c3e
  1. 6
      src/ImGui.NET.SampleProgram/ImGuiController.cs

@ -244,11 +244,11 @@ namespace ImGuiNET
/// <summary>
/// Recreates the device texture used to render text.
/// </summary>
public unsafe void RecreateFontDeviceTexture(GraphicsDevice gd)
public void RecreateFontDeviceTexture(GraphicsDevice gd)
{
ImGuiIOPtr io = ImGui.GetIO();
// Build
byte* pixels;
IntPtr pixels;
int width, height, bytesPerPixel;
io.Fonts.GetTexDataAsRGBA32(out pixels, out width, out height, out bytesPerPixel);
// Store our identifier
@ -264,7 +264,7 @@ namespace ImGuiNET
_fontTexture.Name = "ImGui.NET Font Texture";
gd.UpdateTexture(
_fontTexture,
(IntPtr)pixels,
pixels,
(uint)(bytesPerPixel * width * height),
0,
0,

Loading…
Cancel
Save