Java Code Examples for javax.media.opengl.GL#GL_RGB

The following examples show how to use javax.media.opengl.GL#GL_RGB . 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 6 votes vote down vote up
public static int convertTextureFormat(Format fmt){
    switch (fmt){
        case Alpha16:
        case Alpha8:
            return GL.GL_ALPHA;
        case Luminance8Alpha8:
        case Luminance16Alpha16:
            return GL.GL_LUMINANCE_ALPHA;
        case Luminance8:
        case Luminance16:
            return GL.GL_LUMINANCE;
        case RGB10:
        case RGB16:
        case BGR8:
        case RGB8:
        case RGB565:
            return GL.GL_RGB;
        case RGB5A1:
        case RGBA16:
        case RGBA8:
            return GL.GL_RGBA;
        default:
            throw new UnsupportedOperationException("Unrecognized format: "+fmt);
    }
}
 
Example 2
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 GL.GL_ALPHA;
        case Luminance8Alpha8:
        case Luminance16Alpha16:
            return GL.GL_LUMINANCE_ALPHA;
        case Luminance8:
        case Luminance16:
            return GL.GL_LUMINANCE;
        case RGB10:
        case RGB16:
        case BGR8:
        case RGB8:
        case RGB565:
            return GL.GL_RGB;
        case RGB5A1:
        case RGBA16:
        case RGBA8:
            return GL.GL_RGBA;
        case Depth:
            return GL2ES2.GL_DEPTH_COMPONENT;
        default:
            throw new UnsupportedOperationException("Unrecognized format: " + fmt);
    }
}