Android support, attempt-1 #8
@@ -29,12 +29,12 @@ bool raybriEGLInit(
|
|||||||
EGLContext *ctx,
|
EGLContext *ctx,
|
||||||
EGLDisplay *display
|
EGLDisplay *display
|
||||||
){
|
){
|
||||||
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
*display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||||
if (display == EGL_NO_DISPLAY) {
|
if (*display == EGL_NO_DISPLAY) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eglInitialize(display, NULL, NULL) == EGL_FALSE) {
|
if (eglInitialize(*display, NULL, NULL) == EGL_FALSE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,14 +44,14 @@ bool raybriEGLInit(
|
|||||||
|
|
||||||
EGLint cfgCount = 0;
|
EGLint cfgCount = 0;
|
||||||
if (
|
if (
|
||||||
eglChooseConfig(display, RAYBRI_EGL_CFG, &cfg, 1, &cfgCount) == EGL_FALSE ||
|
eglChooseConfig(*display, RAYBRI_EGL_CFG, cfg, 1, &cfgCount) == EGL_FALSE ||
|
||||||
cfgCount < 1
|
cfgCount < 1
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = eglCreateContext(display, cfg, EGL_NO_CONTEXT, RAYBRI_EGL_CTX);
|
*ctx = eglCreateContext(*display, *cfg, EGL_NO_CONTEXT, RAYBRI_EGL_CTX);
|
||||||
if (ctx == EGL_NO_CONTEXT) {
|
if (*ctx == EGL_NO_CONTEXT) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,15 +65,15 @@ bool raybriEGLResetSurface(
|
|||||||
EGLSurface *surface
|
EGLSurface *surface
|
||||||
) {
|
) {
|
||||||
// Destroy previous surface
|
// Destroy previous surface
|
||||||
if (surface != EGL_NO_SURFACE) {
|
if (*surface != EGL_NO_SURFACE) {
|
||||||
eglDestroySurface(display, surface);
|
eglDestroySurface(*display, *surface);
|
||||||
surface = EGL_NO_SURFACE;
|
*surface = EGL_NO_SURFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new surface
|
// Create new surface
|
||||||
// ANGLE on iOS takes a CALayer as the native window
|
// ANGLE on iOS takes a CALayer as the native window
|
||||||
surface = eglCreateWindowSurface(display, cfg, (EGLNativeWindowType)caLayer, NULL);
|
*surface = eglCreateWindowSurface(*display, *cfg, (EGLNativeWindowType)caLayer, NULL);
|
||||||
if (surface == EGL_NO_SURFACE) {
|
if (*surface == EGL_NO_SURFACE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user