diff options
| author | Ray <[email protected]> | 2018-11-17 00:46:42 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2018-11-17 00:46:42 +0100 |
| commit | c8385aba83438d5e1df0ce6d18f844c81e06857d (patch) | |
| tree | 807c8aab73a8b2d71f586de38d6ed59f24db27d3 | |
| parent | ed9ef642ad2cf343fe9c7bceabc1d57ddeede0d3 (diff) | |
| download | raylib-c8385aba83438d5e1df0ce6d18f844c81e06857d.tar.gz raylib-c8385aba83438d5e1df0ce6d18f844c81e06857d.zip | |
Review SetWindowIcon()
| -rw-r--r-- | src/core.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -763,18 +763,21 @@ void ToggleFullscreen(void) void SetWindowIcon(Image image) { #if defined(PLATFORM_DESKTOP) - ImageFormat(&image, UNCOMPRESSED_R8G8B8A8); + Image imicon = ImageCopy(image); + ImageFormat(&imicon, UNCOMPRESSED_R8G8B8A8); - GLFWimage icon[1]; + GLFWimage imicon[1] = { 0 }; - icon[0].width = image.width; - icon[0].height = image.height; - icon[0].pixels = (unsigned char *)image.data; + icon[0].width = imicon.width; + icon[0].height = imicon.height; + icon[0].pixels = (unsigned char *)imicon.data; - // NOTE: We only support one image icon + // NOTE 1: We only support one image icon + // NOTE 2: The specified image data is copied before this function returns glfwSetWindowIcon(window, 1, icon); // TODO: Support multi-image icons --> image.mipmaps + UnloadImage(imicon); #endif } |
