From 360be210c24d7ca75c3e41b3b31b78e88aed0ffb 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 23:01:59 +0300 Subject: [PATCH] egl cmp --- .../{raybri/ios/raybriEGL.h => egl/egl.h} | 28 +++++++++---------- .../ios/raybriEGLConst.h => egl/eglConst.h} | 20 ++++++------- components/raybri/ios/raybri.c | 14 +++++----- ogs-blue/ver-ios/src/egl/egl.h | 1 + ogs-blue/ver-ios/src/egl/eglConst.h | 1 + ogs-blue/ver-ios/src/raybri/raybriEGL.h | 1 - ogs-blue/ver-ios/src/raybri/raybriEGLConst.h | 1 - 7 files changed, 33 insertions(+), 33 deletions(-) rename components/{raybri/ios/raybriEGL.h => egl/egl.h} (70%) rename components/{raybri/ios/raybriEGLConst.h => egl/eglConst.h} (50%) create mode 120000 ogs-blue/ver-ios/src/egl/egl.h create mode 120000 ogs-blue/ver-ios/src/egl/eglConst.h delete mode 120000 ogs-blue/ver-ios/src/raybri/raybriEGL.h delete mode 120000 ogs-blue/ver-ios/src/raybri/raybriEGLConst.h diff --git a/components/raybri/ios/raybriEGL.h b/components/egl/egl.h similarity index 70% rename from components/raybri/ios/raybriEGL.h rename to components/egl/egl.h index 4a4297b..6b151b6 100644 --- a/components/raybri/ios/raybriEGL.h +++ b/components/egl/egl.h @@ -1,27 +1,27 @@ -#ifndef RAYBRI_EGL_H -#define RAYBRI_EGL_H +#ifndef EGL_H +#define EGL_H +#include "eglConst.h" #include #include -#include "raybriEGLConst.h" #include -typedef struct RaybriEGLState { +typedef struct EGLState { void *caLayer; EGLConfig cfg; EGLContext ctx; EGLDisplay display; EGLSurface surface; -} RaybriEGLState; +} EGLState; -bool raybriEGLInit(RaybriEGLState *st); -bool raybriEGLResetSurface(RaybriEGLState *st); +bool eglInit(EGLState *st); +bool eglResetSurface(EGLState *st); // Source -#if defined(RAYBRI_EGL_IMPLEMENTATION) +#if defined(EGL_IMPLEMENTATION) -bool raybriEGLInit(RaybriEGLState *st) { +bool eglInit(EGLState *st) { st->display = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (st->display == EGL_NO_DISPLAY) { return false; @@ -37,13 +37,13 @@ bool raybriEGLInit(RaybriEGLState *st) { EGLint cfgCount = 0; if ( - eglChooseConfig(st->display, RAYBRI_EGL_CFG, &st->cfg, 1, &cfgCount) == EGL_FALSE || + eglChooseConfig(st->display, EGL_CFG, &st->cfg, 1, &cfgCount) == EGL_FALSE || cfgCount < 1 ) { return false; } - st->ctx = eglCreateContext(st->display, st->cfg, EGL_NO_CONTEXT, RAYBRI_EGL_CTX); + st->ctx = eglCreateContext(st->display, st->cfg, EGL_NO_CONTEXT, EGL_CTX); if (st->ctx == EGL_NO_CONTEXT) { return false; } @@ -51,7 +51,7 @@ bool raybriEGLInit(RaybriEGLState *st) { return true; } -bool raybriEGLResetSurface(RaybriEGLState *st) { +bool eglResetSurface(EGLState *st) { // Destroy previous surface if (st->surface != EGL_NO_SURFACE) { eglDestroySurface(st->display, st->surface); @@ -73,6 +73,6 @@ bool raybriEGLResetSurface(RaybriEGLState *st) { return true; } -#endif // RAYBRI_EGL_IMPLEMENTATION +#endif // EGL_IMPLEMENTATION -#endif // RAYBRI_EGL_H +#endif // EGL_H diff --git a/components/raybri/ios/raybriEGLConst.h b/components/egl/eglConst.h similarity index 50% rename from components/raybri/ios/raybriEGLConst.h rename to components/egl/eglConst.h index 91953d1..b164ce6 100644 --- a/components/raybri/ios/raybriEGLConst.h +++ b/components/egl/eglConst.h @@ -1,16 +1,18 @@ -#ifndef RAYBRI_EGL_CONST_H -#define RAYBRI_EGL_CONST_H +#ifndef EGL_CONST_H +#define EGL_CONST_H #include // Header -extern const EGLint RAYBRI_EGL_CFG[]; -extern const EGLint RAYBRI_EGL_CTX[]; +extern const EGLint EGL_CFG[]; +extern const EGLint EGL_CTX[]; // Source -const EGLint RAYBRI_EGL_CFG[] = { +#if defined(EGL_CONST_IMPLEMENTATION) + +const EGLint EGL_CFG[] = { EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 8, @@ -21,13 +23,11 @@ const EGLint RAYBRI_EGL_CFG[] = { EGL_NONE }; -const EGLint RAYBRI_EGL_CTX[] = { +const EGLint EGL_CTX[] = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE }; -#if defined(RAYBRI_EGL_CONST_IMPLEMENTATION) +#endif // EGL_CONST_IMPLEMENTATION -#endif // RAYBRI_EGL_CONST_IMPLEMENTATION - -#endif // RAYBRI_EGL_CONST_H +#endif // EGL_CONST_H diff --git a/components/raybri/ios/raybri.c b/components/raybri/ios/raybri.c index d1fec88..2834d5a 100644 --- a/components/raybri/ios/raybri.c +++ b/components/raybri/ios/raybri.c @@ -1,17 +1,17 @@ #include "raybri.h" -#define RAYBRI_EGL_CONST_IMPLEMENTATION -#include "raybriEGLConst.h" +#define EGL_CONST_IMPLEMENTATION +#include "eglConst.h" -#define RAYBRI_EGL_IMPLEMENTATION -#include "raybriEGL.h" +#define EGL_IMPLEMENTATION +#include "egl.h" #define RLGL_IMPLEMENTATION #include "rlgl.h" #include -static RaybriEGLState globalES = { +static EGLState globalES = { .caLayer = NULL, .cfg = NULL, .ctx = EGL_NO_CONTEXT, @@ -24,10 +24,10 @@ void raybriInit(void *layer) { globalES.caLayer = layer; - if (!raybriEGLInit(&globalES)) { + if (!eglInit(&globalES)) { raybriLog("ERROR Could not initialize EGL"); } - if (!raybriEGLResetSurface(&globalES)) { + if (!eglResetSurface(&globalES)) { raybriLog("ERROR Could not reset EGL surface"); } diff --git a/ogs-blue/ver-ios/src/egl/egl.h b/ogs-blue/ver-ios/src/egl/egl.h new file mode 120000 index 0000000..9cfd5c7 --- /dev/null +++ b/ogs-blue/ver-ios/src/egl/egl.h @@ -0,0 +1 @@ +../../../../components/egl/egl.h \ No newline at end of file diff --git a/ogs-blue/ver-ios/src/egl/eglConst.h b/ogs-blue/ver-ios/src/egl/eglConst.h new file mode 120000 index 0000000..73ad711 --- /dev/null +++ b/ogs-blue/ver-ios/src/egl/eglConst.h @@ -0,0 +1 @@ +../../../../components/egl/eglConst.h \ No newline at end of file diff --git a/ogs-blue/ver-ios/src/raybri/raybriEGL.h b/ogs-blue/ver-ios/src/raybri/raybriEGL.h deleted file mode 120000 index 7566dfa..0000000 --- a/ogs-blue/ver-ios/src/raybri/raybriEGL.h +++ /dev/null @@ -1 +0,0 @@ -../../../../components/raybri/ios/raybriEGL.h \ No newline at end of file diff --git a/ogs-blue/ver-ios/src/raybri/raybriEGLConst.h b/ogs-blue/ver-ios/src/raybri/raybriEGLConst.h deleted file mode 120000 index 2674f03..0000000 --- a/ogs-blue/ver-ios/src/raybri/raybriEGLConst.h +++ /dev/null @@ -1 +0,0 @@ -../../../../components/raybri/ios/raybriEGLConst.h \ No newline at end of file