public PrimitiveType.Kind getPrimitiveTypeFromNativeType(Class native_type) { PrimitiveType.Kind kind = native_types_to_primitive.get(native_type); if (kind == null) throw new RuntimeException("Unsupported type " + native_type); return kind; }
static { native_types_to_primitive = new HashMap<Class, PrimitiveType.Kind>(); native_types_to_primitive.put(GLbitfield.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLcharARB.class, PrimitiveType.Kind.BYTE); native_types_to_primitive.put(GLclampf.class, PrimitiveType.Kind.FLOAT); native_types_to_primitive.put(GLfloat.class, PrimitiveType.Kind.FLOAT); native_types_to_primitive.put(GLint.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLshort.class, PrimitiveType.Kind.SHORT); native_types_to_primitive.put(GLsizeiptr.class, PrimitiveType.Kind.LONG); native_types_to_primitive.put(GLuint.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLboolean.class, PrimitiveType.Kind.BOOLEAN); native_types_to_primitive.put(GLchar.class, PrimitiveType.Kind.BYTE); native_types_to_primitive.put(GLdouble.class, PrimitiveType.Kind.DOUBLE); native_types_to_primitive.put(GLhalf.class, PrimitiveType.Kind.SHORT); native_types_to_primitive.put(GLintptrARB.class, PrimitiveType.Kind.LONG); native_types_to_primitive.put(GLsizei.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLushort.class, PrimitiveType.Kind.SHORT); native_types_to_primitive.put(GLbyte.class, PrimitiveType.Kind.BYTE); native_types_to_primitive.put(GLclampd.class, PrimitiveType.Kind.DOUBLE); native_types_to_primitive.put(GLenum.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLhandleARB.class, PrimitiveType.Kind.INT); native_types_to_primitive.put(GLintptr.class, PrimitiveType.Kind.LONG); native_types_to_primitive.put(GLsizeiptrARB.class, PrimitiveType.Kind.LONG); native_types_to_primitive.put(GLubyte.class, PrimitiveType.Kind.BYTE); native_types_to_primitive.put(GLvoid.class, PrimitiveType.Kind.BYTE); native_types_to_primitive.put(GLint64EXT.class, PrimitiveType.Kind.LONG); native_types_to_primitive.put(GLuint64EXT.class, PrimitiveType.Kind.LONG); }