Example usage for android.opengl GLES20 GL_LINEAR_MIPMAP_LINEAR

List of usage examples for android.opengl GLES20 GL_LINEAR_MIPMAP_LINEAR

Introduction

In this page you can find the example usage for android.opengl GLES20 GL_LINEAR_MIPMAP_LINEAR.

Prototype

int GL_LINEAR_MIPMAP_LINEAR

To view the source code for android.opengl GLES20 GL_LINEAR_MIPMAP_LINEAR.

Click Source Link

Usage

From source file:Main.java

public static void initTexture(Resources res, BitmapFactory.Options opts, int resource, int handle) {
    Bitmap bmp = BitmapFactory.decodeResource(res, resource, opts);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, handle);
    GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bmp, 0);
    GLES20.glGenerateMipmap(GLES20.GL_TEXTURE_2D);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR_MIPMAP_LINEAR);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
    bmp.recycle();//from w w w . java 2s  .co m
}