Fix build errors on macOS 26. (#728)

* Fix build errors on macOS 26.

* Use OpenGLES for iOS, OpenGL for macOS.

* Correct a typo in the target defines.
This commit is contained in:
Stefanos Stefanidis 2025-11-03 21:31:16 +02:00 committed by GitHub
parent 47736862a7
commit d6aaa6b9da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 45 additions and 0 deletions

View File

@ -1,8 +1,21 @@
#include "d3drmrenderer_opengles2.h"
#include "meshutils.h"
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IOS
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#else
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#define GL_DEPTH_COMPONENT24_OES GL_DEPTH_COMPONENT24
#define GL_DEPTH_COMPONENT32_OES GL_DEPTH_COMPONENT32
#endif
#else
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#endif
#include <SDL3/SDL.h>
#include <algorithm>
#include <string>

View File

@ -1,8 +1,22 @@
#include "d3drmrenderer_opengles3.h"
#include "meshutils.h"
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IOS
#include <OpenGLES/ES2/glext.h>
#include <OpenGLES/ES3/gl.h>
#else
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#define glBindVertexArray glBindVertexArrayAPPLE
#define glGenVertexArrays glGenVertexArraysAPPLE
#define glDeleteVertexArrays glDeleteVertexArraysAPPLE
#endif
#else
#include <GLES2/gl2ext.h>
#include <GLES3/gl3.h>
#endif
#include <SDL3/SDL.h>
#include <algorithm>
#include <string>

View File

@ -4,7 +4,16 @@
#include "d3drmtexture_impl.h"
#include "ddraw_impl.h"
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IOS
#include <OpenGLES/ES2/gl.h>
#else
#include <OpenGL/gl.h>
#endif
#else
#include <GLES2/gl2.h>
#endif
#include <SDL3/SDL.h>
#include <vector>

View File

@ -4,7 +4,16 @@
#include "d3drmtexture_impl.h"
#include "ddraw_impl.h"
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IOS
#include <OpenGLES/ES3/gl.h>
#else
#include <OpenGL/gl.h>
#endif
#else
#include <GLES3/gl3.h>
#endif
#include <SDL3/SDL.h>
#include <vector>