Created
June 18, 2015 10:24
-
-
Save arturoc/e6ebdb036e3a4268db4f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EGLContext context = eglGetCurrentContext(); | |
EGLDisplay eglDisplay = eglGetCurrentDisplay(); | |
glBindTexture(GL_TEXTURE_2D, 0); | |
EGLint imageAttributes[] = { | |
EGL_GL_TEXTURE_LEVEL_KHR, 0, // mip map level to reference | |
EGL_IMAGE_PRESERVED_KHR, EGL_FALSE, | |
EGL_NONE | |
}; | |
EGLImageKHR (*eglCreateImageKHR)(EGLDisplay,EGLContext,int,EGLClientBuffer,EGLint*); | |
get_egl_extension("eglCreateImageKHR",eglCreateImageKHR); | |
void (*eglDestroyImageKHR)() = eglGetProcAddress("eglDestroyImageKHR"); | |
if(eglCreateImageKHR==NULL){ | |
ofLogError()<<"eglCreateImageKHR not found"; | |
}else{ | |
eglImage = eglCreateImageKHR(eglDisplay, context, EGL_GL_TEXTURE_2D_KHR, | |
reinterpret_cast<EGLClientBuffer>(&windowBuffer), | |
imageAttributes); | |
if (eglImage == EGL_NO_IMAGE_KHR){ | |
ofLogError() << "Create EGLImage FAIL"; | |
return; | |
}else{ | |
ofLogNotice() << "Create EGLImage PASS"; | |
} | |
currentPathTexture->bind(); | |
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage); | |
currentPathTexture-Zunbind(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment