예제 #1
0
        public ManaWindow()
            : base(1280,
                   720,
                   new GraphicsMode(32, 16, 0, 8),
                   "Mana Window",
                   GameWindowFlags.Default,
                   DisplayDevice.Default,
                   4,
                   6,
                   GraphicsContextFlags.ForwardCompatible | GraphicsContextFlags.Debug)
        {
            Console.Title = "Mana Console";
            VSync         = VSyncMode.Off;

            if (MainWindow == null)
            {
                MainWindow = this;
            }

            RenderContext = RenderContext.WrapWindowContext(this);
            RenderContext.Validate(true);

            InputProvider = new ManaWindowInputProvider(this);
            Input.SetInputProvider(InputProvider);

            _projectionMatrix = Matrix4x4.CreateOrthographicOffCenter(0f, Width, Height, 0f, -1f, 1f);
        }
예제 #2
0
        public ManaWindow(InitializationParameters initializationParameters)
            : base(GameWindowSettings.Default, GetNativeWindowSettings(initializationParameters))
        {
            _pendingInitializationParameters = initializationParameters;

            if (MainWindow == null)
            {
                MainWindow = this;
            }
            else
            {
                throw new InvalidOperationException("Only one ManaWindow is supported at this time.");
            }

            Console.Clear();
            Console.Title = "Mana Console";

            _log.Info($"Current Working Directory: {Directory.GetCurrentDirectory()}");

            InputProvider         = new ManaWindowInputProvider(this);
            Input.CurrentProvider = InputProvider;

            RenderContext = RenderContext.WrapWindowContext(this);

            _projectionMatrix = Matrix4.CreateOrthographicOffCenter(0f, Width, Height, 0f, -1f, 1f);
        }