Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to make more interfaces to work with the canvas #1

Closed
artrointel opened this issue Feb 3, 2022 · 1 comment
Closed

Need to make more interfaces to work with the canvas #1

artrointel opened this issue Feb 3, 2022 · 1 comment

Comments

@artrointel
Copy link
Owner

https://github.com/artrointel/CanvasOverGLES/blob/a6a07dab393f4c17009de382da07cb1e9d790070/app/src/main/java/com/artrointel/canvasovergles/glview/renderers/CanvasRenderer.java#L64

public void setCanvasBufferUpdatedListener(@nullable CanvasBufferUpdatedListener listener) {
mSurfaceTextureListener = listener;
mSurfaceTexture.setOnFrameAvailableListener(mSurfaceTextureListener); // call updateTexImage() to render canvas by ext. image safely. should be called in gl thread.
}

and also have

public void unlockCanvasAndPost() {
unlockCanvasAndPostInternal();
if(mSurfaceTextureListener == null) {
// unsafely update if there is no listener.
mSurfaceTexture.updateTexImage();
}
}

@artrointel
Copy link
Owner Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant