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(); }
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(); }
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(); }