diff options
| author | raysan5 <[email protected]> | 2017-02-05 03:00:35 +0100 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2017-02-05 03:00:35 +0100 |
| commit | c4bd214cf07c68476c4ce972766c24ee54a982f6 (patch) | |
| tree | a9005c0a74aedb6c627ff89d161f913888e3783f /src/core.c | |
| parent | 1a879ba08efe1877c26a76bfabd43f282d2b2a97 (diff) | |
| download | raylib-c4bd214cf07c68476c4ce972766c24ee54a982f6.tar.gz raylib-c4bd214cf07c68476c4ce972766c24ee54a982f6.zip | |
Added function SetWindowIcon()
Only DESKTOP platforms (Windows, Linus, OSX)
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -524,7 +524,7 @@ bool IsWindowMinimized(void) #endif } -// Fullscreen toggle +// Fullscreen toggle (only PLATFORM_DESKTOP) void ToggleFullscreen(void) { #if defined(PLATFORM_DESKTOP) @@ -540,6 +540,25 @@ void ToggleFullscreen(void) #endif } +// Set icon for window (only PLATFORM_DESKTOP) +void SetWindowIcon(Image image) +{ +#if defined(PLATFORM_DESKTOP) + ImageFormat(&image, UNCOMPRESSED_R8G8B8A8); + + GLFWimage icon[1]; + + icon[0].width = image.width; + icon[0].height = image.height; + icon[0].pixels = (unsigned char *)image.data; + + // NOTE: We only support one image icon + glfwSetWindowIcon(window, 1, icon); + + // TODO: Support multi-image icons --> image.mipmaps +#endif +} + // Get current screen width int GetScreenWidth(void) { |
