Esempio n. 1
0
 public void Begin()
 {
     ImGuiController.ImGui_ImplOpenGL3_NewFrame();
     ImGuiController.ImGui_ImplGlfw_NewFrame();
     ImGui.NewFrame();
     ImGuizmo.BeginFrame();
 }
Esempio n. 2
0
        internal void Init()
        {
            Main = this;

            Engine.MainWindow.TextInput += TextInput;

            IntPtr context = ImGui.CreateContext();

            ImGui.SetCurrentContext(context);
            ImGuizmo.SetImGuiContext(context);

            ImGuiIOPtr io = ImGui.GetIO();

            io.Fonts.AddFontFromFileTTF(Path.Combine(AppContext.BaseDirectory, "EditorAssets/Fonts/Inconsolata.ttf"), 16);

            io.BackendFlags |= ImGuiBackendFlags.HasMouseCursors | ImGuiBackendFlags.RendererHasVtxOffset;
            io.ConfigFlags  |= ImGuiConfigFlags.DockingEnable | ImGuiConfigFlags.NavEnableKeyboard;
            io.ConfigWindowsResizeFromEdges = true;

            SetStyle();

            CreateDeviceResources();
            SetKeyMappings();

            SetPerFrameImGuiData(0.166666f);

            ImGui.NewFrame();
            ImGuizmo.BeginFrame();
            frameBegun = true;
        }
Esempio n. 3
0
        public void BeginFrame()
        {
#if DEBUG
            using Profiler fullProfiler = new Profiler(GetType());
#endif
            frameBegun = true;
            ImGui.NewFrame();
            ImGuizmo.BeginFrame();
        }
Esempio n. 4
0
        public static unsafe void BeforeFrame()
        {
            if (!Initialised)
            {
                throw new Exception("Tried to call BeforeFrame before initialising.");
            }
            SetContext();

            ImGui.NewFrame();
            ImGuizmo.BeginFrame();
            NewFrame = true;
        }
Esempio n. 5
0
        internal void Update(float dt)
        {
            if (frameBegun)
            {
                ImGui.Render();
            }

            SetPerFrameImGuiData(dt);
            UpdateImGuiInput();

            frameBegun = true;
            ImGui.NewFrame();
            ImGuizmo.BeginFrame();
        }