Support iOS for ogs-blue #7

Merged
kornerr merged 55 commits from iosblue into master 2026-10-30 14:17:25 +00:00
2 changed files with 23 additions and 1 deletions
Showing only changes of commit 2fbaba4a51 - Show all commits

No files matched your search

+4
View File
@@ -1,4 +1,8 @@
#include "raybri.h" #include "raybri.h"
#define RAYBRI_EGL_CONST_IMPLEMENTATION
#include "raybriEGLConst.h"
#define RAYBRI_EGL_IMPLEMENTATION #define RAYBRI_EGL_IMPLEMENTATION
#include "raybriEGL.h" #include "raybriEGL.h"
+19 -1
View File
@@ -3,6 +3,7 @@
#include <libEGL/libEGL.h> #include <libEGL/libEGL.h>
#include <libGLESv2/GLES/gl.h> #include <libGLESv2/GLES/gl.h>
#include "raybriEGLConst.h"
#include <stdbool.h> #include <stdbool.h>
// Header // Header
@@ -14,7 +15,11 @@ bool raybriEGLInit(void);
#if defined(RAYBRI_EGL_IMPLEMENTATION) #if defined(RAYBRI_EGL_IMPLEMENTATION)
bool raybriEGLInit(void) { 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) { if (display == EGL_NO_DISPLAY) {
return false; return false;
} }
@@ -27,6 +32,19 @@ bool raybriEGLInit(void) {
return false; 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; return true;
} }