Example #1
0
        public void Draw()
        {
            ImGui.PushID(_scopeId);
            var isOpen = ImGui.CollapsingHeader(_name);

            NezImGui.ShowContextMenuTooltip();

            if (ImGui.BeginPopupContextItem())
            {
                if (ImGui.Selectable("Remove Renderer"))
                {
                    if (Core.Scene is ECScene s)
                    {
                        isOpen = false;
                        s.RemoveRenderer(_renderer);
                        ImGui.CloseCurrentPopup();
                    }
                }

                ImGui.EndPopup();
            }

            if (isOpen)
            {
                ImGui.Indent();

                _materialInspector.Draw();

                ImGui.Checkbox("shouldDebugRender", ref Renderer.ShouldDebugRender);

                var value = Renderer.RenderTargetClearColor.ToNumerics();
                if (ImGui.ColorEdit4("renderTargetClearColor", ref value))
                {
                    Renderer.RenderTargetClearColor = value.ToXNAColor();
                }

                if (Renderer.Camera != null)
                {
                    if (NezImGui.LabelButton("Camera", Renderer.Camera.Entity.Name))
                    {
                        Core.GetGlobalManager <ImGuiManager>().StartInspectingEntity(Renderer.Camera.Entity);
                    }
                }

                ImGui.PushStyleVar(ImGuiStyleVar.Alpha, ImGui.GetStyle().Alpha * 0.5f);
                NezImGui.DisableNextWidget();
                var tempBool = Renderer.WantsToRenderToSceneRenderTarget;
                ImGui.Checkbox("wantsToRenderToSceneRenderTarget", ref tempBool);

                NezImGui.DisableNextWidget();
                tempBool = Renderer.WantsToRenderAfterPostProcessors;
                ImGui.Checkbox("wantsToRenderAfterPostProcessors", ref tempBool);
                ImGui.PopStyleVar();

                ImGui.Unindent();
            }

            ImGui.PopID();
        }
Example #2
0
 /// <summary>
 /// default implementation disables the next widget and calls through to drawMutable. If specialy drawing needs to
 /// be done (such as a multi-widget setup) this can be overridden.
 /// </summary>
 public virtual void drawReadOnly()
 {
     NezImGui.DisableNextWidget();
     drawMutable();
 }