0

I have four classes to understand opengles at my first opengles education:

  • myRenderer
  • myGLSurfaceViev
  • myActivity
  • myTriangle

I want to get touch events on my surface.. but after ı set myRenderer, ı see my triangle on the screen but ı cant get touch event.

If I set mySurfaceView first without myRenderer in myActivity, ı get touch events.. but ı cant see my triangle.

What is the mistake here?

Tim
  • 35,413
  • 11
  • 95
  • 121
  • 1
    Can you please show the code you are using? We can't answer without having some idea of what you're doing. – Tim Sep 25 '12 at 19:49
  • ı tried to send my all code, soo much. but finally, ı left it. Stack didnt accept my very tall code.. :) – futuristixa Sep 25 '12 at 19:55
  • ı can send with email.. if some friends want it.. – futuristixa Sep 25 '12 at 19:55
  • You need to trim the code down to only the relevant parts. Perhaps the SurfaceView onCreate methods, and any onTouch/onTouchEvents that you have overridden, plus anything else you think that might be relevant. – Tim Sep 25 '12 at 20:25

2 Answers2

0

You could write in "Render" like this:

public boolean onTouchEvent(MotionEvent event)
{
    // codes here
}

then add event codes in myActivity like this:

public boolean onTouchEvent(MotionEvent event)
{
    myRender.onTouchEvent(event);
    return super.onTouchEvent(event);
}

i could see View and get touch event in my codes. So, what about you?

  • ı have onTouchEvent in mySurfaceView and ı have your second code part in onTouchEvent in mySurfaceView.. but ı still cant get touch events in my renderer... Even stacks doesnt accept my code and ı cant share my code sample here.. ı tried again just now.. but it didnt accept again.. :))) ı think, ı have an unaccebtable code in all world.. :D – futuristixa Sep 26 '12 at 17:00
  • i am sorry that it doesn't help you. – Zhuang Pearl Sep 27 '12 at 01:17
0

I implemented onTouchEvent on GLSurfaceView and sent events to GLSurfaceView.Renderer. You can implement onTouchEvent on myGLSurfaceViev.

Can I read your codes via here, gist, github repository or email?

Dalinaum
  • 1,142
  • 13
  • 18