A game framework written with osu! in mind.
at master 38 lines 1.2 kB view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4using System; 5using System.Collections.Generic; 6using System.IO; 7using osu.Framework.Platform.Linux.SDL2; 8 9namespace osu.Framework.Platform.Linux 10{ 11 public class LinuxGameHost : DesktopGameHost 12 { 13 internal LinuxGameHost(string gameName, bool bindIPC = false, bool portableInstallation = false) 14 : base(gameName, bindIPC, portableInstallation) 15 { 16 } 17 18 protected override IWindow CreateWindow() => new SDL2DesktopWindow(); 19 20 public override IEnumerable<string> UserStoragePaths 21 { 22 get 23 { 24 string xdg = Environment.GetEnvironmentVariable("XDG_DATA_HOME"); 25 26 if (!string.IsNullOrEmpty(xdg)) 27 yield return xdg; 28 29 yield return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), ".local", "share"); 30 31 foreach (var path in base.UserStoragePaths) 32 yield return path; 33 } 34 } 35 36 public override Clipboard GetClipboard() => new SDL2Clipboard(); 37 } 38}