fix(rendering): Don't try to set window icon on macOS
import org.terasology.engine.rendering.ShaderManager;
import org.terasology.engine.rendering.ShaderManagerLwjgl;
import org.terasology.engine.rendering.nui.internal.LwjglCanvasRenderer;
+import org.terasology.engine.utilities.OS;
import org.terasology.gestalt.assets.module.ModuleAwareAssetTypeManager;
import org.terasology.nui.canvas.CanvasRenderer;
@@ -156,6 +157,7 @@ private void initWindow() {
GLFW.glfwSwapInterval(0);
}
+ if (OS.get() != OS.MACOSX) {
try {
String root = "org/terasology/engine/icons/";
ClassLoader classLoader = getClass().getClassLoader();
@@ -169,11 +171,13 @@ private void initWindow() {
buffer.put(1, LwjglGraphicsUtil.convertToGLFWFormat(icon32));
buffer.put(2, LwjglGraphicsUtil.convertToGLFWFormat(icon64));
buffer.put(3, LwjglGraphicsUtil.convertToGLFWFormat(icon128));
+ // Not supported on Mac: Code: 65548, Description: Cocoa: Regular windows do not have icons on macOS
GLFW.glfwSetWindowIcon(window, buffer);
} catch (IOException | IllegalArgumentException e) {
logger.warn("Could not set icon", e);
}
+ }
lwjglDisplay.setDisplayModeSetting(config.getDisplayModeSetting(), false);
