Java Code Examples for android.opengl.GLES20#GL_DEPTH_COMPONENT16

The following examples show how to use android.opengl.GLES20#GL_DEPTH_COMPONENT16 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TextureUtil.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static int convertTextureFormat(Format fmt){
    switch (fmt){
        case Alpha16:
        case Alpha8:
            return GL10.GL_ALPHA;
        case Luminance8Alpha8:
        case Luminance16Alpha16:
            return GL10.GL_LUMINANCE_ALPHA;
        case Luminance8:
        case Luminance16:
            return GL10.GL_LUMINANCE;
        case RGB10:
        case RGB16:
        case BGR8:
        case RGB8:
        case RGB565:
            return GL10.GL_RGB;
        case RGB5A1:
        case RGBA16:
        case RGBA8:
            return GL10.GL_RGBA;
            
        case Depth:
            return GLES20.GL_DEPTH_COMPONENT;
        case Depth16:
            return GLES20.GL_DEPTH_COMPONENT16;
        case Depth24:
        case Depth32:
        case Depth32F:
            throw new UnsupportedOperationException("Unsupported depth format: " + fmt);   
            
        case DXT1A:
            throw new UnsupportedOperationException("Unsupported format: " + fmt);
        default:
            throw new UnsupportedOperationException("Unrecognized format: " + fmt);
    }
}