Exemple #1
0
        internal void Init()
        {
            Main = this;

            //Application.Main.CursorVisible = false;

            Engine.MainWindow.TextInput += TextInput;

            IntPtr context = ImGui.CreateContext();

            ImGui.SetCurrentContext(context);

            var 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;

            ImGui.StyleColorsDark();

            CreateDeviceResources();
            SetKeyMappings();

            SetPerFrameImGuiData(0.166666f);

            ImGui.NewFrame();
            frameBegun = true;
        }
        private void Start()
        {
            if (Main == null)
            {
                Main = this;
            }

            ERenderer = (EditorRenderer)Engine.Renderer;

            //init editor gui
            ImGuiController.RegisterImGui(ImGuiRenderer);

            BaseEntity.AddComponent <GridRenderer>();
            BaseEntity.AddComponent <SceneHierachy>();
            BaseEntity.AddComponent <Inspector>();
            BaseEntity.AddComponent <AssetManager>();

            editorCamera = new Entity("EditorCamera");
            editorCamera.AddComponent <Camera>();
            cm = editorCamera.AddComponent <CameraMove>();

            editorCamera.Unlist();
        }
Exemple #3
0
 private void Start()
 {
     //register ImGui
     ImGuiController.RegisterImGui(ImGuiRenderer);
 }