How to force a call to onDrawFrame() on a GLSurfaceView?
I have a UI that haes a GLSurfaceView that shows a polygon.
The UI haves also two buttons ZoomIn and ZoomOut. When the user press these buttons, the zoomIn() and zoomOut() methods of myGLSurfaceView are called.
The problem is that i want that the method onDrawFrame get's called to get reflected the zoom in & out.
Why i want this? because the buttons have setClickable(true); why? because i need that if the user leaves the finger presing the button, the zoom get'开发者_运维问答s applied continuosly until the user releases the buton.
Now it works but it works bad, i need to refresh the GLsurfaceview forcing onDrawFrame
Call gLSurfaceView.requestRender(). This will (from link):
Request that the renderer render a frame. This method is typically used when the render mode has been set to RENDERMODE_WHEN_DIRTY, so that frames are only rendered on demand. May be called from any thread. Must not be called before a renderer has been set.
solved using threads and press/release events of the finger
精彩评论