Ejemplo n.º 1
0
        public void OnAddedToGame(Game game)
        {
            _game = game;
            ImGui.SetCurrentContext(ImGui.CreateContext());
            IO = ImGui.GetIO();

            var version = ImGui.GetVersion();

            _log.Info("ImGui Version: " + version);

            KeyMap = EnumHelper.GetValues <ImGuiKey>()
                     .Where(x => x != ImGuiKey.COUNT)
                     .Select(x => IO.KeyMap[(int)x] = (int)ImGuiKeyHelper.ToOpenTKKey(x))
                     .ToArray();

            InitializeFonts();
            InitializeStyle();

            IO.ConfigFlags |= ImGuiConfigFlags.DockingEnable;
            IO.ConfigDockingTransparentPayload = true;

            if (UseViewports)
            {
                IO.BackendFlags |= ImGuiBackendFlags.HasMouseHoveredViewport;
                IO.BackendFlags |= ImGuiBackendFlags.PlatformHasViewports;
                IO.BackendFlags |= ImGuiBackendFlags.RendererHasViewports;
                IO.ConfigFlags  |= ImGuiConfigFlags.ViewportsEnable;
            }

            _renderer = new ImGuiRenderer(this, ManaWindow.MainWindow);

            ImGuiGLFWCallbacks.InitPlatformInterface();
        }
Ejemplo n.º 2
0
        public void OnAddedToGame(Game game)
        {
            _game = game;
            ImGui.SetCurrentContext(ImGui.CreateContext());
            IO = ImGui.GetIO();

            Keys = EnumHelper.GetValues <ImGuiKey>()
                   .Where(x => x != ImGuiKey.COUNT)
                   .Select(x => IO.KeyMap[(int)x] = (int)ImGuiKeyHelper.ToOpenTKKey(x))
                   .ToArray();

            InitializeFonts();
            InitializeStyle();

            // IO.ConfigFlags |= ImGuiConfigFlags.DockingEnable;
            // IO.ConfigDockingTransparentPayload = true;
            //
            // if (UseViewports)
            // {
            //     //_io.BackendFlags |= ImGuiBackendFlags.HasMouseHoveredViewport;
            //
            //     IO.BackendFlags |= ImGuiBackendFlags.PlatformHasViewports;
            //     IO.BackendFlags |= ImGuiBackendFlags.RendererHasViewports;
            //     IO.ConfigFlags |= ImGuiConfigFlags.ViewportsEnable;
            //     _viewportManager = new ImGuiViewportManager(this);
            // }

            _renderer = new ImGuiRenderer(this, ManaWindow.MainWindow);
        }