From c86b30a35ad75218d5b1d8dfbcba87dc28920741 Mon Sep 17 00:00:00 2001 From: ikpil Date: Thu, 6 Apr 2023 23:32:00 +0900 Subject: [PATCH] fix macos --- src/DotRecast.Recast.Demo/Draw/ModernOpenGLDraw.cs | 2 +- src/DotRecast.Recast.Demo/RecastDemo.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/DotRecast.Recast.Demo/Draw/ModernOpenGLDraw.cs b/src/DotRecast.Recast.Demo/Draw/ModernOpenGLDraw.cs index 11dd3a7..680c818 100644 --- a/src/DotRecast.Recast.Demo/Draw/ModernOpenGLDraw.cs +++ b/src/DotRecast.Recast.Demo/Draw/ModernOpenGLDraw.cs @@ -76,7 +76,7 @@ public class ModernOpenGLDraw : OpenGLDraw public unsafe void init() { - string SHADER_VERSION = "#version 400\n"; + string SHADER_VERSION = PlatformID.MacOSX == Environment.OSVersion.Platform ? "#version 400\n" : "#version 460\n"; string vertex_shader = SHADER_VERSION + "uniform mat4 ProjMtx;\n" // + "uniform mat4 ViewMtx;\n" // + "in vec3 Position;\n" // diff --git a/src/DotRecast.Recast.Demo/RecastDemo.cs b/src/DotRecast.Recast.Demo/RecastDemo.cs index ff352f6..a73f679 100644 --- a/src/DotRecast.Recast.Demo/RecastDemo.cs +++ b/src/DotRecast.Recast.Demo/RecastDemo.cs @@ -19,10 +19,8 @@ freely, subject to the following restrictions: */ using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.Immutable; -using System.Diagnostics; using System.IO; using System.Linq; using System.Numerics; @@ -270,6 +268,7 @@ public class RecastDemo options.Position = new Vector2D((resolution.X - width) / 2, (resolution.Y - height) / 2); options.VSync = false; options.ShouldSwapAutomatically = false; + options.PreferredDepthBufferBits = 24; window = Window.Create(options); if (window == null)