diff --git a/FDK/src/01.Framework/Core/Game.cs b/FDK/src/01.Framework/Core/Game.cs index 791a12e6..ed8a3924 100644 --- a/FDK/src/01.Framework/Core/Game.cs +++ b/FDK/src/01.Framework/Core/Game.cs @@ -30,6 +30,7 @@ using SkiaSharp; using FDK; using Silk.NET.GLFW; using System.Runtime.InteropServices; +using Silk.NET.Core; namespace SampleFramework { @@ -43,6 +44,8 @@ namespace SampleFramework internal static List AsyncActions = new(); + private string strIconFileName; + protected string _Text = ""; protected string Text { @@ -244,11 +247,20 @@ namespace SampleFramework //GetError(); } + private RawImage GetIconData(string fileName) + { + SKCodec codec = SKCodec.Create(fileName); + using SKBitmap bitmap = SKBitmap.Decode(codec, new SKImageInfo(codec.Info.Width, codec.Info.Height, SKColorType.Rgba8888)); + return new RawImage(bitmap.Width, bitmap.Height, bitmap.GetPixelSpan().ToArray()); + } + /// /// Initializes a new instance of the class. /// - protected Game() + protected Game(string iconFileName) { + strIconFileName = iconFileName; + MainThreadID = Thread.CurrentThread.ManagedThreadId; Configuration(); @@ -266,11 +278,13 @@ namespace SampleFramework options.API = GraphicsAPI.None; options.WindowBorder = WindowBorder.Resizable; options.Title = Text; - + + Silk.NET.Windowing.Glfw.GlfwWindowing.Use(); //Silk.NET.Windowing.Sdl.SdlWindowing.Use(); Window_ = Window.Create(options); + Window_.Load += Window_Load; Window_.Closing += Window_Closing; Window_.Update += Window_Update; @@ -393,6 +407,8 @@ namespace SampleFramework public void Window_Load() { + Window_.SetWindowIcon(new ReadOnlySpan(GetIconData(strIconFileName))); + Context = new AngleContext(GraphicsDeviceType_, Window_); Context.MakeCurrent(); diff --git a/OpenTaiko/src/Common/TJAPlayer3.cs b/OpenTaiko/src/Common/TJAPlayer3.cs index 09e2d704..2dec7fcc 100644 --- a/OpenTaiko/src/Common/TJAPlayer3.cs +++ b/OpenTaiko/src/Common/TJAPlayer3.cs @@ -539,7 +539,7 @@ namespace TJAPlayer3 // コンストラクタ - public TJAPlayer3() + public TJAPlayer3() : base("OpenTaiko.ico") { TJAPlayer3.app = this; }