Compare commits

...

1 Commits

Author SHA1 Message Date
max
71657cf8d8 Nerfed icon test
created an icon for fun
2024-07-05 23:05:07 +02:00
2 changed files with 11 additions and 0 deletions

BIN
Nerfed.Runtime/Assets/Textures/NerfedIcon.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -87,6 +87,14 @@ public Window(GraphicsDevice graphicsDevice, WindowCreateInfo windowCreateInfo)
Width = (uint) width;
Height = (uint) height;
unsafe
{
byte* pixels = ImageUtils.GetPixelDataFromFile(Path.Combine(System.AppContext.BaseDirectory, "Assets", "Textures", "NerfedIcon.png"), out uint w, out uint h, out uint size);
nint icon = SDL.SDL_CreateRGBSurfaceFrom(new IntPtr(pixels), (int)w, (int)h, 8 * 4, (int)w * 4, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
SDL.SDL_SetWindowIcon(Handle, icon);
ImageUtils.FreePixelData(pixels);
}
windowsById.Add(SDL.SDL_GetWindowID(Handle), this);
}