// Path: src/jp/gauzau/MikuMikuDroid/Miku.java
// public class RenderSet {
// 	public String shader;
// 	public String target;
// 	public RenderSet(String s, String t) {
// 		shader = s;
// 		target = t;
// 	}
// }


import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import jp.gauzau.MikuMikuDroid.Miku.RenderSet;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.graphics.BitmapFactory;
import android.hardware.Camera;
import android.opengl.GLES20;
import android.opengl.GLU;
import android.os.Build;
import android.util.Log;

			GLES20.glActiveTexture(GLES20.GL_TEXTURE2);
			//GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);
			mRT.get("screenR").bindTexture();
	
			GLES20.glDrawElements(GLES20.GL_TRIANGLES, 6, GLES20.GL_UNSIGNED_SHORT, mBgIndex);
		} else {
			mRT.get("screen").switchTargetFrameBuffer();
			draw();
		}

		
//		GLES20.glFlush();
//		checkGlError(TAG);
		mCoreLogic.onDraw(pos);
	//	Log.d("",""+(System.currentTimeMillis() -  start));
	}
	
	private void draw() {
		GLES20.glClearColor(0, 0, 1.0f, 1.0f);
		GLES20.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
		initializeAllTexture(false);
//		initializeAllSkinningTexture();

		String bg = mCoreLogic.getBG();

		////////////////////////////////////////////////////////////////////
		//// draw models
		if (mCoreLogic.getMiku() != null) {
			for (Miku miku : mCoreLogic.getMiku()) {
				if(miku.mModel.mIsTextureLoaded) {

// Path: src/jp/gauzau/MikuMikuDroid/Miku.java
// public class RenderSet {
// 	public String shader;
// 	public String target;
// 	public RenderSet(String s, String t) {
// 		shader = s;
// 		target = t;
// 	}
// }


// Path: src/jp/gauzau/MikuMikuDroid/MikuRendererGLES20.java
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import jp.gauzau.MikuMikuDroid.Miku.RenderSet;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.graphics.BitmapFactory;
import android.hardware.Camera;
import android.opengl.GLES20;
import android.opengl.GLU;
import android.os.Build;
import android.util.Log;

			GLES20.glActiveTexture(GLES20.GL_TEXTURE2);
			//GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);
			mRT.get("screenR").bindTexture();
	
			GLES20.glDrawElements(GLES20.GL_TRIANGLES, 6, GLES20.GL_UNSIGNED_SHORT, mBgIndex);
		} else {
			mRT.get("screen").switchTargetFrameBuffer();
			draw();
		}

		
//		GLES20.glFlush();
//		checkGlError(TAG);
		mCoreLogic.onDraw(pos);
	//	Log.d("",""+(System.currentTimeMillis() -  start));
	}
	
	private void draw() {
		GLES20.glClearColor(0, 0, 1.0f, 1.0f);
		GLES20.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
		initializeAllTexture(false);
//		initializeAllSkinningTexture();

		String bg = mCoreLogic.getBG();

		////////////////////////////////////////////////////////////////////
		//// draw models
		if (mCoreLogic.getMiku() != null) {
			for (Miku miku : mCoreLogic.getMiku()) {
				if(miku.mModel.mIsTextureLoaded) {

					for(RenderSet rs: miku.mRenderSenario) {
