Skip to content Skip to sidebar Skip to footer

Opengl-es Ontouchevents Problem Or A Draw Problem?

I am just getting started with using opengl in my apps and I get it fine =) but I've hit a brick wall recently as I have been attempting to work out methods of user input. I decide

Solution 1:

Two problems here.

1) You are using your own, custom onTouchEvent() method. Your method onTouchEvent() with the arguments MotionEvent event, GL10 gl has no official support in the SDK.

2) You are modifying data that explicitly are running in another thread. The touch event's threads differs from the GL thread.

Your solution is simple. Override onTouchEvent(MotionEvent event) (or set an onTouchListener to your GLSurfaceView class) in your activity class and call a method (which should be declared as synchronized) in your view class within it. An alternative is to update logic in a different thread, however, that is up to you to decide.

Post a Comment for "Opengl-es Ontouchevents Problem Or A Draw Problem?"