public static void Main() { BasicGameHost host = Host.GetSuitableHost(); host.Load(new SampleGame()); host.Run(); }
internal static void Initialize(BasicGameHost host) { if (IsInitialized) { return; } GLWrapper.host = host; resetScheduler.SetCurrentThread(); MaxTextureSize = Math.Min(2048, GL.GetInteger(GetPName.MaxTextureSize)); // Create a global vertex array int vertexArray; GL.CreateVertexArrays(1, out vertexArray); GL.BindVertexArray(vertexArray); GL.Disable(EnableCap.DepthTest); GL.Disable(EnableCap.StencilTest); GL.Enable(EnableCap.Blend); GL.Enable(EnableCap.ScissorTest); IsInitialized = true; }
public static void Main() { BasicGameHost host = Host.GetSuitableHost(); host.Load(new VisualTestGame()); host.Run(); }
public BeatmapImporter(BasicGameHost host, BeatmapDatabase beatmaps = null) { this.beatmaps = beatmaps; channel = new IpcChannel <BeatmapImportMessage>(host); channel.MessageReceived += messageReceived; }
public BeatmapImporter(BasicGameHost host, BeatmapDatabase beatmaps = null) { this.beatmaps = beatmaps; channel = new IpcChannel<BeatmapImportMessage>(host); channel.MessageReceived += messageReceived; }
public override bool Initialize(BasicGameHost host) { host.InputScheduler.Add(new ScheduledDelegate(delegate { OpenTK.Input.MouseState state = OpenTK.Input.Mouse.GetCursorState(); Point point = host.Window.PointToClient(new Point(state.X, state.Y)); //todo: reimplement if necessary //Vector2 pos = Vector2.Multiply(point, Vector2.Divide(host.DrawSize, this.Size)); Vector2 pos = new Vector2(point.X, point.Y); var tkState = new TkMouseState(state, pos); if (!host.IsActive) { tkState.ButtonStates.ForEach(s => s.State = false); tkState.Wheel = tkState.LastState?.Wheel ?? 0; } PendingStates.Enqueue(new InputState { Mouse = tkState }); }, 0, 0)); return(true); }
public static void Main(string[] args) { BasicGameHost host = Host.GetSuitableHost(@"osu-visual-tests"); host.Add(new VisualTestGame()); host.Run(); }
public override void SetHost(BasicGameHost host) { if (LocalConfig == null) { LocalConfig = new OsuConfigManager(host.Storage); } base.SetHost(host); }
public static void Main() { using (BaseGame game = new SampleGame()) using (BasicGameHost host = Host.GetSuitableHost(@"sample-game")) { host.Add(game); host.Run(); } }
public static void Main() { using (Game game = new SampleGame()) using (BasicGameHost host = Host.GetSuitableHost()) { host.Load(game); host.Run(); } }
public void SetHost(BasicGameHost host) { this.host = host; host.ExitRequested += OnExiting; form.FormClosing += OnFormClosing; form.DragEnter += dragEnter; form.DragDrop += dragDrop; }
private void load(BasicGameHost host) { atlas = new TextureAtlas(GLWrapper.MaxTextureSize, GLWrapper.MaxTextureSize, true, All.Nearest); Add(new FrameStatisticsDisplay(@"Input", host.InputMonitor, atlas)); Add(new FrameStatisticsDisplay(@"Update", host.UpdateMonitor, atlas)); Add(new FrameStatisticsDisplay(@"Draw", host.DrawMonitor, atlas)); Direction = FlowDirection.VerticalOnly; }
private OsuGameBase loadOsu(BasicGameHost host) { var osu = new OsuGameBase(); host.Add(osu); //reset beatmap database (sqlite and storage backing) osu.Beatmaps.Reset(); return(osu); }
public override bool Initialize(BasicGameHost host) { PressedKeys = new List <Key>(); host.InputScheduler.Add(new ScheduledDelegate(delegate { state = host.IsActive ? OpenTK.Input.Keyboard.GetState() : new KeyboardState(); }, 0, 0)); return(true); }
public override bool Initialize(BasicGameHost host) { this.host = host; host.InputScheduler.Add(new ScheduledDelegate(delegate { state = OpenTK.Input.Mouse.GetCursorState(); nativePosition = host.Window.PointToClient(new Point(state.X, state.Y)); }, 0, 0)); return(true); }
public override bool Initialize(BasicGameHost host) { host.InputThread.Scheduler.Add(new ScheduledDelegate(delegate { PendingStates.Enqueue(new InputState { Keyboard = new TkKeyboardState(host.IsActive ? OpenTK.Input.Keyboard.GetState() : new OpenTK.Input.KeyboardState()) }); }, 0, 0)); return(true); }
/// <summary> /// As Load is run post host creation, you can override this method to alter properties of the host before it makes itself visible to the user. /// </summary> /// <param name="host"></param> public virtual void SetHost(BasicGameHost host) { this.host = host; host.Exiting += OnExiting; if (form != null) { form.FormClosing += OnFormClosing; form.DragEnter += dragEnter; form.DragDrop += dragDrop; } }
public static void Main(string[] args) { using (BasicGameHost host = Host.GetSuitableHost(@"osu-visual-tests")) { Ruleset.Register(new OsuRuleset()); Ruleset.Register(new TaikoRuleset()); Ruleset.Register(new ManiaRuleset()); Ruleset.Register(new CatchRuleset()); host.Add(new VisualTestGame()); host.Run(); } }
public void SetHost(BasicGameHost host) { MainThread = Thread.CurrentThread; this.host = host; host.Exiting += (sender, args) => { OnExiting(this, args); }; Window = new Window(host); form.FormClosing += OnFormClosing; form.DragEnter += dragEnter; form.DragDrop += dragDrop; }
/// <summary> /// Registers statistics counters to the PerformanceMonitors of the _first_ host /// to call this function. /// </summary> /// <param name="target">The host that wants to register for statistics counters.</param> internal static void RegisterCounters(BasicGameHost target) { if (FrameStatistics.target != null) { return; } FrameStatistics.target = target; for (StatisticsCounterType i = 0; i < StatisticsCounterType.AmountTypes; ++i) { getMonitor(i).RegisterCounter(i); } }
public override void SetHost(BasicGameHost host) { base.SetHost(host); var desktopWindow = host.Window as DesktopGameWindow; if (desktopWindow != null) { desktopWindow.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); desktopWindow.Title = @"osu!lazer"; desktopWindow.DragEnter += dragEnter; desktopWindow.DragDrop += dragDrop; } }
private OsuGameBase loadOsu(BasicGameHost host) { var osu = new OsuGameBase(); host.Add(osu); while (!osu.IsLoaded) { Thread.Sleep(1); } //reset beatmap database (sqlite and storage backing) osu.Beatmaps.Reset(); return(osu); }
/// <summary> /// As Load is run post host creation, you can override this method to alter properties of the host before it makes itself visible to the user. /// </summary> /// <param name="host"></param> public virtual void SetHost(BasicGameHost host) { if (Config == null) { Config = new FrameworkConfigManager(host.Storage); } this.host = host; host.Size = new Vector2(Config.Get <int>(FrameworkConfig.Width), Config.Get <int>(FrameworkConfig.Height)); host.Exiting += OnExiting; if (Window != null) { Window.Title = $@"osu.Framework (running ""{Name}"")"; } }
public static void Main(string[] args) { bool benchmark = args.Length > 0 && args[0] == @"-benchmark"; BasicGameHost host = Host.GetSuitableHost(); if (benchmark) { host.Load(new Benchmark()); } else { host.Load(new VisualTestGame()); } host.Run(); }
public static BasicGameHost GetSuitableHost() { BasicGameHost host = null; GraphicsContextFlags flags = GraphicsContextFlags.Default; if (RuntimeInfo.IsUnix) { host = new LinuxGameHost(flags); } else { host = new WindowsGameHost(flags); } return(host); }
public static void Main(string[] args) { bool benchmark = args.Length > 0 && args[0] == @"-benchmark"; using (BasicGameHost host = Host.GetSuitableHost(@"visual-tests")) { if (benchmark) { host.Add(new Benchmark()); } else { host.Add(new VisualTestGame()); } host.Run(); } }
public BeatmapDatabase(BasicStorage storage, BasicGameHost importHost = null) { this.storage = storage; if (importHost != null) { ipc = new BeatmapImporter(importHost, this); } if (connection == null) { connection = storage.GetDatabase(@"beatmaps"); connection.CreateTable <BeatmapMetadata>(); connection.CreateTable <BaseDifficulty>(); connection.CreateTable <BeatmapSetInfo>(); connection.CreateTable <BeatmapInfo>(); } }
private void load(BasicGameHost host, AudioManager audio) { this.audio = audio; textInput = host.GetTextInput(); if (textInput != null) { textInput.OnNewImeComposition += delegate(string s) { textUpdateScheduler.Add(() => onImeComposition(s)); cursorAndLayout.Invalidate(); }; textInput.OnNewImeResult += delegate(string s) { textUpdateScheduler.Add(() => onImeResult(s)); cursorAndLayout.Invalidate(); }; } }
internal static void Initialize(BasicGameHost host) { if (IsInitialized) { return; } GLWrapper.host = host; resetScheduler.SetCurrentThread(); MaxTextureSize = Math.Min(2048, GL.GetInteger(GetPName.MaxTextureSize)); GL.Disable(EnableCap.DepthTest); GL.Disable(EnableCap.StencilTest); GL.Enable(EnableCap.Blend); GL.Enable(EnableCap.ScissorTest); IsInitialized = true; }
public static void Main(string[] args) { bool benchmark = args.Length > 0 && args[0] == @"-benchmark"; using (BasicGameHost host = Host.GetSuitableHost(@"osu")) { Ruleset.Register(new OsuRuleset()); Ruleset.Register(new TaikoRuleset()); Ruleset.Register(new ManiaRuleset()); Ruleset.Register(new CatchRuleset()); if (benchmark) { host.Add(new Benchmark()); } else { host.Add(new VisualTestGame()); } host.Run(); } }
public BeatmapDatabase(BasicStorage storage, BasicGameHost importHost = null) { this.storage = storage; if (importHost != null) { ipc = new BeatmapImporter(importHost, this); } if (connection == null) { try { connection = prepareConnection(); } catch { Console.WriteLine(@"Failed to initialise the beatmap database! Trying again with a clean database..."); storage.DeleteDatabase(@"beatmaps"); connection = prepareConnection(); } } }
private OsuGameBase loadOsu(BasicGameHost host) { var osu = new OsuGameBase(); host.Add(osu); while (!osu.IsLoaded) Thread.Sleep(1); //reset beatmap database (sqlite and storage backing) osu.Dependencies.Get<BeatmapDatabase>().Reset(); return osu; }
public override void SetHost(BasicGameHost host) { if (Config == null) Config = new OsuConfigManager(host.Storage); base.SetHost(host); }
public override void SetHost(BasicGameHost host) { base.SetHost(host); host.Size = new Vector2(Config.Get<int>(OsuConfig.Width), Config.Get<int>(OsuConfig.Height)); }
public PlayerInputManager(BasicGameHost host) : base(host) { }