From 2fbaba4a5149fe4aea9afea34506accbd954b023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Thu, 29 Oct 2026 16:09:18 +0300 Subject: [PATCH] some --- components/raybri/ios/raybri.c | 4 ++++ components/raybri/ios/raybriEGL.h | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/components/raybri/ios/raybri.c b/components/raybri/ios/raybri.c index 0e47f79..bad3d04 100644 --- a/components/raybri/ios/raybri.c +++ b/components/raybri/ios/raybri.c @@ -1,4 +1,8 @@ #include "raybri.h" + +#define RAYBRI_EGL_CONST_IMPLEMENTATION +#include "raybriEGLConst.h" + #define RAYBRI_EGL_IMPLEMENTATION #include "raybriEGL.h" diff --git a/components/raybri/ios/raybriEGL.h b/components/raybri/ios/raybriEGL.h index 1f172fa..3949779 100644 --- a/components/raybri/ios/raybriEGL.h +++ b/components/raybri/ios/raybriEGL.h @@ -3,6 +3,7 @@ #include #include +#include "raybriEGLConst.h" #include // Header @@ -14,7 +15,11 @@ bool raybriEGLInit(void); #if defined(RAYBRI_EGL_IMPLEMENTATION) bool raybriEGLInit(void) { - EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); + EGLConfig cfg = NULL; + EGLContext ctx = EGL_NO_CONTEXT; + EGLDisplay display = EGL_NO_DISPLAY; + + display = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (display == EGL_NO_DISPLAY) { return false; } @@ -27,6 +32,19 @@ bool raybriEGLInit(void) { return false; } + EGLint cfgCount = 0; + if ( + eglChooseConfig(display, RAYBRI_EGL_CFG, &cfg, 1, &cfgCount) == EGL_FALSE || + cfgCount < 1 + ) { + return false; + } + + ctx = eglCreateContext(display, cfg, EGL_NO_CONTEXT, RAYBRI_EGL_CTX); + if (ctx == EGL_NO_CONTEXT) { + return false; + } + return true; }