PowenKo, Android tutorial 120-12, Opengl with android UI


package com.looptek.AndroidOpenGLESPowenko;

import android.app.Activity;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;


public class TutorialPart012 extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
    	this.requestWindowFeature(Window.FEATURE_NO_TITLE); 
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
 		GLSurfaceView view = new GLSurfaceView(this);
   		view.setRenderer(new TutorialPart011OpenRenderer(this));

   		Context context =getAppContext();
   		EditText editBox =new EditText(this);
   		editBox.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

   		editBox.setText("Hello, PowenKo.com");

   		setContentView(view);

   		addContentView(editBox, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
   		
   		
   		////////
   		
    }
    public  Context getAppContext(){
    	return TutorialPart012.this.getApplicationContext();
    }
    
}

sample code:

AndroidOpenGLESPowenko-12


Leave a Reply