Android support, attempt-1 #8

Open
kornerr wants to merge 62 commits from and1 into master
pull from: and1
Showing only changes of commit f76932fd91 - Show all commits
+11 -11
View File
@@ -29,12 +29,12 @@ bool raybriEGLInit(
EGLContext *ctx,
EGLDisplay *display
){
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (display == EGL_NO_DISPLAY) {
*display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (*display == EGL_NO_DISPLAY) {
return false;
}
if (eglInitialize(display, NULL, NULL) == EGL_FALSE) {
if (eglInitialize(*display, NULL, NULL) == EGL_FALSE) {
return false;
}
@@ -44,14 +44,14 @@ bool raybriEGLInit(
EGLint cfgCount = 0;
if (
eglChooseConfig(display, RAYBRI_EGL_CFG, &cfg, 1, &cfgCount) == EGL_FALSE ||
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) {
*ctx = eglCreateContext(*display, *cfg, EGL_NO_CONTEXT, RAYBRI_EGL_CTX);
if (*ctx == EGL_NO_CONTEXT) {
return false;
}
@@ -65,15 +65,15 @@ bool raybriEGLResetSurface(
EGLSurface *surface
) {
// Destroy previous surface
if (surface != EGL_NO_SURFACE) {
eglDestroySurface(display, surface);
surface = EGL_NO_SURFACE;
if (*surface != EGL_NO_SURFACE) {
eglDestroySurface(*display, *surface);
*surface = EGL_NO_SURFACE;
}
// Create new surface
// ANGLE on iOS takes a CALayer as the native window
surface = eglCreateWindowSurface(display, cfg, (EGLNativeWindowType)caLayer, NULL);
if (surface == EGL_NO_SURFACE) {
*surface = eglCreateWindowSurface(*display, *cfg, (EGLNativeWindowType)caLayer, NULL);
if (*surface == EGL_NO_SURFACE) {
return false;
}