1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use crate::GL::types::*;

pub trait IdxType {
	const TYPE: GLenum;
}
impl IdxType for u8 {
	const TYPE: GLenum = gl::UNSIGNED_BYTE;
}
impl IdxType for u16 {
	const TYPE: GLenum = gl::UNSIGNED_SHORT;
}
impl IdxType for u32 {
	const TYPE: GLenum = gl::UNSIGNED_INT;
}

pub trait AttrType {
	const TYPE: GLenum;
}
impl AttrType for i8 {
	const TYPE: GLenum = gl::BYTE;
}
impl AttrType for u8 {
	const TYPE: GLenum = gl::UNSIGNED_BYTE;
}
impl AttrType for i16 {
	const TYPE: GLenum = gl::SHORT;
}
impl AttrType for u16 {
	const TYPE: GLenum = gl::UNSIGNED_SHORT;
}
impl AttrType for i32 {
	const TYPE: GLenum = gl::INT;
}
impl AttrType for u32 {
	const TYPE: GLenum = gl::UNSIGNED_INT;
}
impl AttrType for f16 {
	const TYPE: GLenum = gl::HALF_FLOAT;
}
impl AttrType for f32 {
	const TYPE: GLenum = gl::FLOAT;
}
impl AttrType for f64 {
	const TYPE: GLenum = gl::DOUBLE;
}