Ejemplo n.º 1
0
        private void ApplyVideoMode()
        {
            CluwneLib.Stop();

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



            CluwneLib.Go();
        }
Ejemplo n.º 2
0
        public void InitializeCluwneLib(uint width, uint height, bool fullscreen, uint refreshrate)
        {
            GetClock = new Clock();

            CluwneLib.Video.SetWindowSize(width, height);
            CluwneLib.Video.SetFullScreen(fullscreen);
            CluwneLib.Video.SetRefreshRate(refreshrate);

            CluwneLib.Initialize();
            CluwneLib.Window.Graphics.BackgroundColor = Color.Black;
            CluwneLib.Window.Closed += MainWindowRequestClose;

            CluwneLib.Go();
        }
Ejemplo n.º 3
0
        public void InitializeCluwneLib()
        {
            GetClock = new Clock();

            CluwneLib.Video.SetWindowSize(1280, 720);
            CluwneLib.Video.SetFullScreen(false);
            CluwneLib.Video.SetRefreshRate(60);

            CluwneLib.Initialize();
            CluwneLib.Window.Graphics.BackgroundColor = Color.Black;
            CluwneLib.Window.Closed += MainWindowRequestClose;

            CluwneLib.Go();
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
0
        private void SetupCluwne()
        {
            _configurationManager.RegisterCVar("display.width", 1280, CVarFlags.ARCHIVE);
            _configurationManager.RegisterCVar("display.height", 720, CVarFlags.ARCHIVE);
            _configurationManager.RegisterCVar("display.fullscreen", false, CVarFlags.ARCHIVE);
            _configurationManager.RegisterCVar("display.refresh", 60, CVarFlags.ARCHIVE);
            _configurationManager.RegisterCVar("display.vsync", false, CVarFlags.ARCHIVE);

            uint displayWidth  = (uint)_configurationManager.GetCVar <int>("display.width");
            uint displayHeight = (uint)_configurationManager.GetCVar <int>("display.height");
            bool isFullscreen  = _configurationManager.GetCVar <bool>("display.fullscreen");
            uint refresh       = (uint)_configurationManager.GetCVar <int>("display.refresh");

            CluwneLib.Video.SetFullscreen(isFullscreen);
            CluwneLib.Video.SetRefreshRate(refresh);
            CluwneLib.Video.SetWindowSize(displayWidth, displayHeight);
            CluwneLib.Initialize();
            if (onetime)
            {
                //every time the video settings change we close the old screen and create a new one
                //SetupCluwne Gets called to reset the event handlers to the new screen
                CluwneLib.FrameEvent           += CluwneLibIdle;
                CluwneLib.RefreshVideoSettings += SetupCluwne;
                onetime = false;
            }
            CluwneLib.Screen.SetMouseCursorVisible(false);
            CluwneLib.Screen.BackgroundColor      = Color.Black;
            CluwneLib.Screen.Resized             += MainWindowResizeEnd;
            CluwneLib.Screen.Closed              += MainWindowRequestClose;
            CluwneLib.Screen.KeyPressed          += KeyDownEvent;
            CluwneLib.Screen.KeyReleased         += KeyUpEvent;
            CluwneLib.Screen.MouseButtonPressed  += MouseDownEvent;
            CluwneLib.Screen.MouseButtonReleased += MouseUpEvent;
            CluwneLib.Screen.MouseMoved          += MouseMoveEvent;
            CluwneLib.Screen.MouseWheelMoved     += MouseWheelMoveEvent;
            CluwneLib.Screen.MouseEntered        += MouseEntered;
            CluwneLib.Screen.MouseLeft           += MouseLeft;
            CluwneLib.Screen.TextEntered         += TextEntered;

            CluwneLib.Go();
            IoCManager.Resolve <IKeyBindingManager>().Initialize();
        }