From 8be7644c3e50db87e1a7a6be9602eb12d438e969 Mon Sep 17 00:00:00 2001 From: giawa Date: Tue, 18 Jun 2019 14:03:25 -0700 Subject: [PATCH] Modify SampleProgram to use 'safe' version of GetTexDataAsRGBA32, which was auto-generated by the CodeGenerator with the new variant functionality. --- src/ImGui.NET.SampleProgram/ImGuiController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ImGui.NET.SampleProgram/ImGuiController.cs b/src/ImGui.NET.SampleProgram/ImGuiController.cs index 64d6ef9..ca40da7 100644 --- a/src/ImGui.NET.SampleProgram/ImGuiController.cs +++ b/src/ImGui.NET.SampleProgram/ImGuiController.cs @@ -244,11 +244,11 @@ namespace ImGuiNET /// /// Recreates the device texture used to render text. /// - 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,