ImGuiNET / ImGui.NET

An ImGui wrapper for .NET.
MIT License
1.91k stars 307 forks source link

Access Violation With using ImGui.Begin #453

Open bennytrt opened 1 year ago

bennytrt commented 1 year ago

Hello, I'm Experiencing an Access Violation error at ImGui.Begin

System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

My Code : `using System; using ImGuiNET; using Veldrid; using Vortice; using Vortice.Direct3D9;

class Program {

static void Main()
{
    ImGui.CreateContext();
    ImGui.StyleColorsDark();

    ImGui.Begin("Atonix - Gmod");

    ImGui.Text("TestTest6969");

    if (ImGui.Button("Click Me For Joe."))
    {
        Console.WriteLine("Joe's Great Ball");
    }

    ImGui.InputText("FiFaFo", IntPtr.Zero, 100, ImGuiInputTextFlags.EnterReturnsTrue, null);

    // commented out becuz i wanna see if i can use this for other stuff
    // ImGui.GetDrawData(); 

    ImGui.Render();

    System.Threading.Thread.Sleep(16);

    ImGui.End();

}

}`

sanny-io commented 11 months ago

I'm also getting this error (.NET 8). This other issue here might be related.

https://github.com/aybe/DearImGui/issues/23

sicusa commented 11 months ago

.NET 8, MacBook Pro M2 Max

using ImGuiNET;

ImGui.CreateContext();
ImGui.StyleColorsDark();
ImGui.NewFrame();

crashed on ImGui.NewFrame().