From 5a870d427e47abd4a8e4ce58a95582ec049434d5 Mon Sep 17 00:00:00 2001 From: Prin_E Date: Thu, 17 Mar 2022 01:53:48 +0900 Subject: [PATCH] Fixed RecastDemo crash in macOS 10.11+ * Set hints to always use OpenGL render driver (instead of Metal driver) * Compile error fix in Xcode 13 --- Recast/Include/RecastAlloc.h | 2 +- RecastDemo/Source/main.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Recast/Include/RecastAlloc.h b/Recast/Include/RecastAlloc.h index 20e8dd1..071278d 100644 --- a/Recast/Include/RecastAlloc.h +++ b/Recast/Include/RecastAlloc.h @@ -22,7 +22,7 @@ #include #include -#include +#include "RecastAssert.h" /// Provides hint values to the memory allocator on how long the /// memory is expected to be used. diff --git a/RecastDemo/Source/main.cpp b/RecastDemo/Source/main.cpp index e9f584d..270c2af 100644 --- a/RecastDemo/Source/main.cpp +++ b/RecastDemo/Source/main.cpp @@ -78,6 +78,9 @@ int main(int /*argc*/, char** /*argv*/) return -1; } + // Use OpenGL render driver. + SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl"); + // Enable depth buffer. SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);