PowenKo, Android tutorial 120-13, Opengl with android user input

September 9, 2011   ·   0 Comments


 

package com.looptek.AndroidOpenGLESPowenko;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.view.MotionEvent;

public class TutorialPart013ClearGLSurfaceView extends GLSurfaceView {

	  public  TutorialPart013OpenRenderer mRenderer;

	  public TutorialPart013ClearGLSurfaceView(Context context) {
	        super(context);
	        mRenderer = new TutorialPart013OpenRenderer(context);
	        setRenderer(mRenderer);
	    }

	    public boolean onTouchEvent(final MotionEvent event) {
	        queueEvent(new Runnable(){
	            public void run() {
	                mRenderer.setColor(event.getX() / getWidth(),
	                        event.getY() / getHeight(), 1.0f);
	            }});
	            return true;
	        }

}

sample code:

AndroidOpenGLESPowenko-13

reference:

http://developer.android.com/resources/articles/glsurfaceview.html

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon