This hook is global for app.
Closed this issue · 3 comments
peerless2012 commented
Run this demo, and we can see, that the SurfaceView is clear to Blue, even if the window backgroud is clear to Blue.
keith2018 commented
Run this demo, and we can see, that the SurfaceView is clear to Blue, even if the window backgroud is clear to Blue.
Yes, it will hook the whole process's GL function call.
if you want to hook the SurfaceView only, try check the egl context before hook
void hook_glClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
EGLContext ctx = eglGetCurrentContext();
if (ctx ...) { // check context
LOGD("hook call glClear: (%f, %f, %f, %f)", red, green, blue, alpha);
if (cb_glClearColor) {
cb_glClearColor(0.f, 0.f, 1.f, 1.f);
}
}
}
peerless2012 commented
Yes! it works, and i create a #2 to impl this feature, please check it.