rendering: don't warn about window icon on macos

This commit is contained in:
Bixilon 2023-02-13 17:28:08 +01:00
parent 843b29ab9a
commit 660ed439ba
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 3 additions and 4 deletions

View File

@ -18,7 +18,7 @@ import de.bixilon.kotlinglm.vec2.Vec2i
import de.bixilon.minosoft.assets.AssetsManager
import de.bixilon.minosoft.config.profile.profiles.rendering.RenderingProfile
import de.bixilon.minosoft.terminal.RunConfiguration
import de.bixilon.minosoft.util.KUtil.toResourceLocation
import de.bixilon.minosoft.util.DesktopUtil
import de.bixilon.minosoft.util.delegate.RenderingDelegate.observeRendering
import de.matthiasmann.twl.utils.PNGDecoder
import org.lwjgl.BufferUtils
@ -81,7 +81,7 @@ interface BaseWindow {
fun setDefaultIcon(assetsManager: AssetsManager) {
val decoder = PNGDecoder(assetsManager["minosoft:textures/icons/window_icon.png".toResourceLocation()])
val decoder = PNGDecoder(assetsManager[DesktopUtil.ICON])
val data = BufferUtils.createByteBuffer(decoder.width * decoder.height * PNGDecoder.Format.RGBA.numComponents)
decoder.decode(data, decoder.width * PNGDecoder.Format.RGBA.numComponents, PNGDecoder.Format.RGBA)
data.flip()

View File

@ -411,8 +411,7 @@ class GLFWWindow(
override fun setIcon(size: Vec2i, buffer: ByteBuffer) {
if (PlatformInfo.OS == OSTypes.MAC) {
Log.log(LogMessageType.RENDERING_GENERAL, LogLevels.WARN) { "Can not set window icon on mac os!" } // ToDo
return
return // the window icon can just be set with the TaskBar api. See DesktopUtil for more information
}
val images = GLFWImage.malloc(1)
val image = GLFWImage.malloc()