Example usage for org.lwjgl.opengl GL30 GL_UNSIGNED_INT_24_8

List of usage examples for org.lwjgl.opengl GL30 GL_UNSIGNED_INT_24_8

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL30 GL_UNSIGNED_INT_24_8.

Prototype

int GL_UNSIGNED_INT_24_8

To view the source code for org.lwjgl.opengl GL30 GL_UNSIGNED_INT_24_8.

Click Source Link

Document

Accepted by the type parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and GetTexImage.

Usage

From source file:com.samrj.devil.graphics.TexUtil.java

License:Open Source License

/**
 * Returns the OpenGL enumerator for the given primitive type.
 * //from  w w w .ja va2s. co m
 * @param format an OpenGL texture format.
 * @return the primitive data type associated with the given OpenGL format.
 */
public static int getPrimitiveType(int format) {
    switch (format) {
    default:
    case GL11.GL_LUMINANCE8:
    case GL11.GL_ALPHA8:
    case GL11.GL_LUMINANCE8_ALPHA8:
    case GL30.GL_R8:
    case GL30.GL_RG8:
    case GL11.GL_RGB8:
    case GL11.GL_RGBA8:
        return GL11.GL_UNSIGNED_BYTE;

    case GL11.GL_LUMINANCE16:
    case GL11.GL_ALPHA16:
    case GL11.GL_LUMINANCE16_ALPHA16:
    case GL14.GL_DEPTH_COMPONENT16:
    case GL30.GL_R16:
    case GL30.GL_RG16:
    case GL11.GL_RGB16:
    case GL11.GL_RGBA16:
        return GL11.GL_UNSIGNED_SHORT;

    case GL30.GL_R16I:
    case GL30.GL_RG16I:
    case GL30.GL_RGB16I:
    case GL30.GL_RGBA16I:
        return GL11.GL_SHORT;

    case GL30.GL_DEPTH_COMPONENT32F:
    case GL30.GL_R32F:
    case GL30.GL_RG32F:
    case GL30.GL_RGB32F:
    case GL30.GL_RGBA32F:
        return GL11.GL_FLOAT;

    case GL30.GL_R32I:
    case GL30.GL_RG32I:
    case GL30.GL_RGB32I:
    case GL30.GL_RGBA32I:
        return GL11.GL_INT;

    case GL30.GL_DEPTH24_STENCIL8:
        return GL30.GL_UNSIGNED_INT_24_8;
    }
}