Beispiel #1
0
        public ImGuiRenderer(ImGuiSystem imguiSystem, ManaWindow window)
        {
            _imGuiSystem   = imguiSystem;
            _window        = window;
            _shaderProgram = ImGuiShaderFactory.CreateShaderProgram(window.RenderContext);

            var offset = _window.Location - ((Size)ManaWindow.MainWindow.Location + new Size(8, 31));

            _projection = Matrix4x4.CreateOrthographicOffCenter(offset.X, _window.Width + offset.X, _window.Height + offset.Y, offset.Y, -1f, 1f);
        }
Beispiel #2
0
        public ImGuiSystem(bool useViewports = false)
        {
            if (Instance != null)
            {
                throw new InvalidOperationException("Only one ImGuiSystem instance may be created.");
            }

            Instance           = this;
            ImGuiHelper.System = this;
            UseViewports       = useViewports;

            Input.KeyTyped += c => IO.AddInputCharacter(c);
        }