Пример #1
0
        public GlScreen(Switch device)
            : base(1280, 720,
                   new GraphicsMode(), "Ryujinx", 0,
                   DisplayDevice.Default, 3, 3,
                   GraphicsContextFlags.ForwardCompatible)
        {
            _device = device;

            if (!(device.Gpu.Renderer is Renderer))
            {
                throw new NotSupportedException($"GPU renderer must be an OpenGL renderer when using GlScreen!");
            }

            _renderer = (Renderer)device.Gpu.Renderer;

            _primaryController = new Input.NpadController(ConfigurationState.Instance.Hid.JoystickControls);

            Location = new Point(
                (DisplayDevice.Default.Width / 2) - (Width / 2),
                (DisplayDevice.Default.Height / 2) - (Height / 2));

#if USE_PROFILING
            // Start profile window, it will handle itself from there
            _profileWindow = new ProfileWindowManager();
#endif
        }
Пример #2
0
        public GLRenderer(Switch device)
            : base(GetGraphicsMode(),
                   3, 3,
                   GraphicsContextFlags.ForwardCompatible)
        {
            WaitEvent = new ManualResetEvent(false);

            _device = device;

            this.Initialized  += GLRenderer_Initialized;
            this.Destroyed    += GLRenderer_Destroyed;
            this.ShuttingDown += GLRenderer_ShuttingDown;

            Initialize();

            _chrono = new System.Diagnostics.Stopwatch();

            _ticksPerFrame = System.Diagnostics.Stopwatch.Frequency / TargetFps;

            _primaryController = new Input.NpadController(ConfigurationState.Instance.Hid.JoystickControls);

            AddEvents((int)(Gdk.EventMask.ButtonPressMask
                            | Gdk.EventMask.ButtonReleaseMask
                            | Gdk.EventMask.PointerMotionMask
                            | Gdk.EventMask.KeyPressMask
                            | Gdk.EventMask.KeyReleaseMask));

            this.Shown += Renderer_Shown;
        }
Пример #3
0
        public GlScreen(Switch device, Renderer renderer)
            : base(1280, 720,
                   new GraphicsMode(), "Ryujinx", 0,
                   DisplayDevice.Default, 3, 3,
                   GraphicsContextFlags.ForwardCompatible)
        {
            _device   = device;
            _renderer = renderer;

            _primaryController = new Input.NpadController(ConfigurationState.Instance.Hid.JoystickControls);

            Location = new Point(
                (DisplayDevice.Default.Width / 2) - (Width / 2),
                (DisplayDevice.Default.Height / 2) - (Height / 2));

#if USE_PROFILING
            // Start profile window, it will handle itself from there
            _profileWindow = new ProfileWindowManager();
#endif
        }