From c550fbf22913e94309256d84543ca982bacbc9e1 Mon Sep 17 00:00:00 2001 From: vsaint1 Date: Sat, 23 May 2026 04:51:23 -0300 Subject: [PATCH] iOS opengles extensions imports --- src/CMakeLists.txt | 11 +++++++++++ src/rlgl.h | 13 ++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5e5dd91ee..adfe7d83a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,12 @@ set(raylib_sources rtextures.c ) +if (${PLATFORM} STREQUAL "iOS") + list(APPEND raylib_sources + rcore_ios_main.m + ) +endif() + # /cmake/GlfwImport.cmake handles the details around the inclusion of glfw if (NOT ${PLATFORM} MATCHES "Web") include(GlfwImport) @@ -104,6 +110,11 @@ target_link_libraries(raylib PUBLIC ${LIBS_PUBLIC}) # and you will be able to select more build options include(CompileDefinitions) +if (${PLATFORM} STREQUAL "iOS") + target_compile_definitions(raylib PRIVATE GLES_SILENCE_DEPRECATION=1) + target_compile_options(raylib PRIVATE -Wno-deprecated-declarations) +endif() + # Registering include directories target_include_directories(raylib PUBLIC diff --git a/src/rlgl.h b/src/rlgl.h index ea5673397..e927abde4 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -876,9 +876,16 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #endif #if defined(GRAPHICS_API_OPENGL_ES3) - #include // OpenGL ES 3.0 library - #define GL_GLEXT_PROTOTYPES - #include // OpenGL ES 2.0 extensions library + #if defined(PLATFORM_IOS) + #include // OpenGL ES 3.0 library + #define GL_GLEXT_PROTOTYPES + #include // OpenGL ES extensions used by raylib + #include // OpenGL ES 3.0 extensions library + #else + #include // OpenGL ES 3.0 library + #define GL_GLEXT_PROTOTYPES + #include // OpenGL ES 2.0 extensions library + #endif #elif defined(GRAPHICS_API_OPENGL_ES2) // NOTE: OpenGL ES 2.0 can be enabled on Desktop platforms, // in that case, functions are loaded from a custom glad for OpenGL ES 2.0