private void ApplyVideoMode()
        {
            CluwneLib.Stop();

            CluwneLib.SetMode((int)ConfigurationManager.GetDisplayWidth(),
                              (int)ConfigurationManager.GetDisplayHeight(),
                              !ConfigurationManager.GetFullscreen(), false, false,
                              (int)ConfigurationManager.GetDisplayRefresh());



            CluwneLib.Go();
        }
Beispiel #2
0
//        private void SetupGorgon()
//        {
//            uint displayWidth = _configurationManager.GetDisplayWidth();
//            uint displayHeight = _configurationManager.GetDisplayHeight();
//            bool fullscreen = _configurationManager.GetFullscreen();
//            var refresh = (int) _configurationManager.GetDisplayRefresh();
//            Size = new Size((int) displayWidth, (int) displayHeight);
//
//            //TODO. Find first compatible videomode and set it if no configuration is present. Else the client might crash due to invalid videomodes on the first start.
//
//            CluwneLib.Initialize();
//            //Gorgon.SetMode(this);
//            CluwneLib.SetMode(this, (int) displayWidth, (int) displayHeight, BackBufferFormats.BufferRGB888, !fullscreen,
//                           false, false, refresh);
//            CluwneLib.Screen.BackgroundColor = Color.FromArgb(50, 50, 50);
//            CluwneLib.CurrentClippingViewport = new Viewport(0, 0, CluwneLib.Screen.Width, CluwneLib.Screen.Height);
//            CluwneLib.DeviceReset += MainWindowResizeEnd;
//            //Gorgon.MinimumFrameTime = PreciseTimer.FpsToMilliseconds(66);
//            CluwneLib.Idle += GorgonIdle;
//        }

        private void SetupCluwne()
        {
            uint displayWidth  = _configurationManager.GetDisplayWidth();
            uint displayHeight = _configurationManager.GetDisplayHeight();
            bool fullscreen    = _configurationManager.GetFullscreen();
            var  refresh       = (int)_configurationManager.GetDisplayRefresh();

            CluwneLib.Go();

            CluwneLib.SetMode((int)displayWidth, (int)displayHeight, fullscreen, false, false, refresh);
            CluwneLib.Screen.BackgroundColor  = Color.Black;
            CluwneLib.CurrentClippingViewport = new Viewport(0, 0, CluwneLib.Screen.Size.X, CluwneLib.Screen.Size.Y);
            CluwneLib.Screen.Resized         += MainWindowResizeEnd;
            CluwneLib.Screen.Closed          += MainWindowRequestClose;
            CluwneLib.Idle += CluwneLibIdle;
        }