opengl draw Texture - Android android.opengl

Android examples for android.opengl:OpenGL Texture

Description

opengl draw Texture

Demo Code


//package com.java2s;

import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.opengles.GL11;
import javax.microedition.khronos.opengles.GL11Ext;

public class Main {
    public static void drawTexture(GL10 gl, int x, int y, int z, int w,
            int h) {
        int[] crop = { 0, h, w, -h };

        ((GL11) gl).glTexParameteriv(GL10.GL_TEXTURE_2D,
                GL11Ext.GL_TEXTURE_CROP_RECT_OES, crop, 0);

        ((GL11Ext) gl).glDrawTexfOES(x, y, z, w, h);

    }//from   w ww  . ja  va2 s  . c om
}

Related Tutorials