code: public static int pixelTypeToGL(
      final JCGLPixelFormat p)
    {
      switch (p) {
        case PIXEL_COMPONENT_BYTE:
          return GL11.GL_BYTE;
        case PIXEL_COMPONENT_FLOAT:
          return GL11.GL_FLOAT;
        case PIXEL_COMPONENT_INT:
          return GL11.GL_INT;
        case PIXEL_COMPONENT_SHORT:
          return GL11.GL_SHORT;
        case PIXEL_COMPONENT_UNSIGNED_BYTE:
          return GL11.GL_UNSIGNED_BYTE;
        case PIXEL_COMPONENT_UNSIGNED_INT:
          return GL11.GL_UNSIGNED_INT;
        case PIXEL_COMPONENT_UNSIGNED_SHORT:
          return GL11.GL_UNSIGNED_SHORT;
        case PIXEL_PACKED_UNSIGNED_INT_1010102:
          return GL12.GL_UNSIGNED_INT_10_10_10_2;
        case PIXEL_PACKED_UNSIGNED_SHORT_4444:
          return GLES20.GL_UNSIGNED_SHORT_4_4_4_4;
        case PIXEL_PACKED_UNSIGNED_SHORT_5551:
          return GLES20.GL_UNSIGNED_SHORT_5_5_5_1;
        case PIXEL_PACKED_UNSIGNED_SHORT_565:
          return GLES20.GL_UNSIGNED_SHORT_5_6_5;
        case PIXEL_COMPONENT_HALF_FLOAT:
          return GL30.GL_HALF_FLOAT;
        case PIXEL_PACKED_UNSIGNED_INT_24_8:
          return GL30.GL_UNSIGNED_INT_24_8;
      }
  
      throw new UnreachableCodeException();
    }
docs: Convert pixel types to GL constants.
  
  @param p The pixel type.
  
  @return The resulting GL constant.