/// <summary> /// Constructs a new ImGuiController. /// </summary> public ImGuiController(int width, int height) { instance = this; _windowWidth = width; _windowHeight = height; IntPtr context = ImGui.CreateContext(); ImGui.SetCurrentContext(context); var io = ImGui.GetIO(); io.Fonts.AddFontDefault(); io.BackendFlags |= ImGuiBackendFlags.RendererHasVtxOffset; io.BackendFlags |= ImGuiBackendFlags.HasMouseCursors; io.ConfigFlags |= ImGuiConfigFlags.DockingEnable; io.ConfigFlags |= ImGuiConfigFlags.ViewportsEnable; io.ConfigWindowsResizeFromEdges = true; io.ConfigDockingWithShift = true; CreateDeviceResources(); SetKeyMappings(); SetPerFrameImGuiData(1f / 60f); ImGui.NewFrame(); //ImGuizmo.SetImGuiContext(context); // //ImGuizmo.BeginFrame(); _frameBegun = true; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); _controller = new ImGuiController(Width, Height); }