Esempio n. 1
0
        /// <summary>
        /// this is where we issue any and all ImGui commands to be drawn
        /// </summary>
        void layoutGui()
        {
            drawMainMenuBar();

            if (showSeperateGameWindow)
            {
                drawGameWindow();
            }
            drawEntityInspectors();

            for (var i = _drawCommands.Count - 1; i >= 0; i--)
            {
                _drawCommands[i]();
            }

            SceneGraphWindow.show(ref showSceneGraphWindow);
            CoreWindow.show(ref showCoreWindow);

            if (showDemoWindow)
            {
                ImGui.ShowDemoWindow(ref showDemoWindow);
            }

            if (showStyleEditor)
            {
                ImGui.Begin("Style Editor", ref showStyleEditor);
                ImGui.ShowStyleEditor();
                ImGui.End();
            }


            // this is just test/junk code
            ImGui.SetNextWindowPos(new Num.Vector2(530, 475), ImGuiCond.FirstUseEver);
            ImGui.SetNextWindowSize(new Num.Vector2(340, 200), ImGuiCond.FirstUseEver);
            if (ImGui.Begin("Debug##junk"))
            {
                ImGui.Text($"Mouse position: {ImGui.GetMousePos()}");
                ImGui.ShowStyleSelector("Style");

                ImGui.Checkbox("Demo Window", ref showDemoWindow);
                ImGui.Checkbox("Style Editor", ref showStyleEditor);
                ImGui.Checkbox("Scene Graph", ref showSceneGraphWindow);
                ImGui.Checkbox("Core Window", ref showCoreWindow);

                ImGui.Separator();

                float framerate = ImGui.GetIO().Framerate;
                ImGui.Text($"Application average {1000.0f / framerate:0.##} ms/frame ({framerate:0.#} FPS)");
                ImGui.End();
            }
        }