From 989d510673af9f1d37bf0b3bcddf356d70f185d6 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 19 Nov 2012 22:20:35 -0500 Subject: [PATCH] support tap-and-drag --- src/com/homelinux/holtrop/opengltest/MyRenderer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/homelinux/holtrop/opengltest/MyRenderer.java b/src/com/homelinux/holtrop/opengltest/MyRenderer.java index 54d09d9..0988779 100644 --- a/src/com/homelinux/holtrop/opengltest/MyRenderer.java +++ b/src/com/homelinux/holtrop/opengltest/MyRenderer.java @@ -197,13 +197,16 @@ public class MyRenderer implements GLSurfaceView.Renderer public boolean onTouchEvent(MotionEvent e) { - if (e.getAction() == MotionEvent.ACTION_DOWN) + if (e.getAction() == MotionEvent.ACTION_DOWN || + e.getAction() == MotionEvent.ACTION_MOVE) { float x = m_aspect * ((e.getX() / (float) m_width) * 2.0f - 1.0f); float y = -((e.getY() / (float) m_height) * 2.0f - 1.0f); m_x = x; m_y = y; + + return true; } return false;