-
Notifications
You must be signed in to change notification settings - Fork 26
/
types_opengl.go
56 lines (45 loc) · 1.33 KB
/
types_opengl.go
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
46
47
48
49
50
51
52
53
54
55
56
// +build !js
package gl
// Enum is equivalent to GLenum, and is normally used with one of the
// constants defined in this package.
type Enum uint32
// Attrib identifies the location of a specific attribute variable.
type Attrib struct {
Value uint
}
// Program identifies a compiled shader program.
type Program struct {
Value uint32
}
// Shader identifies a GLSL shader.
type Shader struct {
Value uint32
}
// Buffer identifies a GL buffer object.
type Buffer struct {
Value uint32
}
// Framebuffer identifies a GL framebuffer.
type Framebuffer struct {
Value uint32
}
// A Renderbuffer is a GL object that holds an image in an internal format.
type Renderbuffer struct {
Value uint32
}
// A Texture identifies a GL texture unit.
type Texture struct {
Value uint32
}
// Uniform identifies the location of a specific uniform variable.
type Uniform struct {
Value int32
}
func (v Attrib) Valid() bool { return v.Value != 0 }
func (v Program) Valid() bool { return v.Value != 0 }
func (v Shader) Valid() bool { return v.Value != 0 }
func (v Buffer) Valid() bool { return v.Value != 0 }
func (v Framebuffer) Valid() bool { return v.Value != 0 }
func (v Renderbuffer) Valid() bool { return v.Value != 0 }
func (v Texture) Valid() bool { return v.Value != 0 }
func (v Uniform) Valid() bool { return v.Value != 0 }