opengl gles Type To String - Android android.opengl

Android examples for android.opengl:OpenGL

Description

opengl gles Type To String

Demo Code


//package com.java2s;
import android.opengl.GLES20;

public class Main {
    public static String gles20TypeToString(int gles20Type) {
        String typeString = "unknown";
        switch (gles20Type) {
        case GLES20.GL_FLOAT:
            typeString = "GL_FLOAT";
            break;
        case GLES20.GL_FLOAT_VEC2:
            typeString = "GL_FLOAT_VEC2";
            break;
        case GLES20.GL_FLOAT_VEC3:
            typeString = "GL_FLOAT_VEC3";
            break;
        case GLES20.GL_FLOAT_VEC4:
            typeString = "GL_FLOAT_VEC4";
            break;
        case GLES20.GL_INT:
            typeString = "GL_INT";
            break;
        case GLES20.GL_INT_VEC2:
            typeString = "GL_INT_VEC2";
            break;
        case GLES20.GL_INT_VEC3:
            typeString = "GL_INT_VEC3";
            break;
        case GLES20.GL_INT_VEC4:
            typeString = "GL_INT_VEC4";
            break;
        case GLES20.GL_BOOL:
            typeString = "GL_BOOL";
            break;
        case GLES20.GL_BOOL_VEC2:
            typeString = "GL_BOOL_VEC2";
            break;
        case GLES20.GL_BOOL_VEC3:
            typeString = "GL_BOOL_VEC3";
            break;
        case GLES20.GL_BOOL_VEC4:
            typeString = "GL_BOOL_VEC4";
            break;
        case GLES20.GL_FLOAT_MAT2:
            typeString = "GL_FLOAT_MAT2";
            break;
        case GLES20.GL_FLOAT_MAT3:
            typeString = "GL_FLOAT_MAT3";
            break;
        case GLES20.GL_FLOAT_MAT4:
            typeString = "GL_FLOAT_MAT4";
            break;
        case GLES20.GL_SAMPLER_2D:
            typeString = "GL_SAMPLER_2D";
            break;
        case GLES20.GL_SAMPLER_CUBE:
            typeString = "GL_SAMPLER_CUBE";
            break;
        default:/* ww w .  j a  va 2  s .com*/
            break;
        }
        return typeString;
    }
}

Related Tutorials