-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
29 lines (26 loc) · 924 Bytes
/
types.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
package renderer
import "syscall/js"
type GLTypes struct {
StaticDraw js.Value
ArrayBuffer js.Value
ElementArrayBuffer js.Value
VertexShader js.Value
FragmentShader js.Value
Float js.Value
DepthTest js.Value
ColorBufferBit js.Value
Triangles js.Value
UnsignedShort js.Value
}
func (types *GLTypes) New(glContext js.Value) {
types.StaticDraw = glContext.Get("STATIC_DRAW")
types.ArrayBuffer = glContext.Get("ARRAY_BUFFER")
types.ElementArrayBuffer = glContext.Get("ELEMENT_ARRAY_BUFFER")
types.VertexShader = glContext.Get("VERTEX_SHADER")
types.FragmentShader = glContext.Get("FRAGMENT_SHADER")
types.Float = glContext.Get("FLOAT")
types.DepthTest = glContext.Get("DEPTH_TEST")
types.ColorBufferBit = glContext.Get("COLOR_BUFFER_BIT")
types.Triangles = glContext.Get("TRIANGLES")
types.UnsignedShort = glContext.Get("UNSIGNED_SHORT")
}