Skip to content

Commit 8be7644

Browse files
committed
Modify SampleProgram to use 'safe' version of GetTexDataAsRGBA32, which was auto-generated by the CodeGenerator with the new variant functionality.
1 parent 5afed42 commit 8be7644

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ImGui.NET.SampleProgram/ImGuiController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ private byte[] GetEmbeddedResourceBytes(string resourceName)
244244
/// <summary>
245245
/// Recreates the device texture used to render text.
246246
/// </summary>
247-
public unsafe void RecreateFontDeviceTexture(GraphicsDevice gd)
247+
public void RecreateFontDeviceTexture(GraphicsDevice gd)
248248
{
249249
ImGuiIOPtr io = ImGui.GetIO();
250250
// Build
251-
byte* pixels;
251+
IntPtr pixels;
252252
int width, height, bytesPerPixel;
253253
io.Fonts.GetTexDataAsRGBA32(out pixels, out width, out height, out bytesPerPixel);
254254
// Store our identifier
@@ -264,7 +264,7 @@ public unsafe void RecreateFontDeviceTexture(GraphicsDevice gd)
264264
_fontTexture.Name = "ImGui.NET Font Texture";
265265
gd.UpdateTexture(
266266
_fontTexture,
267-
(IntPtr)pixels,
267+
pixels,
268268
(uint)(bytesPerPixel * width * height),
269269
0,
270270
0,

0 commit comments

Comments
 (0)