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
This commit is contained in:
Prin_E 2022-03-17 01:53:48 +09:00 committed by Graham Pentheny
parent c5cbd53024
commit 5a870d427e
2 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <RecastAssert.h> #include "RecastAssert.h"
/// Provides hint values to the memory allocator on how long the /// Provides hint values to the memory allocator on how long the
/// memory is expected to be used. /// memory is expected to be used.

View File

@ -78,6 +78,9 @@ int main(int /*argc*/, char** /*argv*/)
return -1; return -1;
} }
// Use OpenGL render driver.
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
// Enable depth buffer. // Enable depth buffer.
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);