开发者

How to force a call to onDrawFrame() on a GLSurfaceView?

开发者 https://www.devze.com 2023-04-10 07:15 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消