Пример #1
0
        public void SetMode(int width, int height, float refreshRate)
        {
            Width  = width;
            Height = height;
            var selectedMode = _findVideoMode(width);

            Lines = ArvidClient.arvid_client_get_video_mode_lines(selectedMode, refreshRate) - 1;
            if (Lines < 0)
            {
                throw new Exception("Could not find a mode that satisfies the selected refresh rate");
            }

            var res = ArvidClient.arvid_client_set_video_mode(selectedMode, Lines);

            if (res < 0)
            {
                throw new Exception("Unable to set Arvid Mode");
            }

            RefreshRate = ArvidClient.arvid_client_get_video_mode_refresh_rate(selectedMode, Lines);
            if (RefreshRate < 0)
            {
                throw new Exception("Unable to get final refresh rate");
            }

            ArvidClient.arvid_client_set_virtual_vsync(Height - 15);

            Console.WriteLine("{0}x{1}@{2}. Asked for {3}", Width, Height, RefreshRate, refreshRate);
        }
Пример #2
0
        public void SetMode(int width, int height)
        {
            Width  = width;
            Height = height;
            var selectedMode = _findVideoMode(width);

            var res = ArvidClient.arvid_client_set_video_mode(selectedMode, Lines);

            if (res < 0)
            {
                throw new Exception("Unable to set Arvid Mode");
            }

            ArvidClient.arvid_client_set_virtual_vsync(Height - 15);

//            if (IntPtr.Zero != _tempDestination) FreeTexture(_tempDestination);
//            _tempDestination = CreateTexture(
//                SDL.SDL_PIXELFORMAT_RGB555,
//                SDL.SDL_TextureAccess.SDL_TEXTUREACCESS_STREAMING,
//                Width,
//                Height
//            );
        }