-
Notifications
You must be signed in to change notification settings - Fork 7
/
types_webgl.go
84 lines (64 loc) · 1.25 KB
/
types_webgl.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build js && !wasm
// +build js,!wasm
package gl
import "github.com/gopherjs/gopherjs/js"
type Enum int
type Attrib struct {
Value int
}
type Program struct {
*js.Object
}
type Shader struct {
*js.Object
}
type Buffer struct {
*js.Object
}
type Framebuffer struct {
*js.Object
}
type Renderbuffer struct {
*js.Object
}
type Texture struct {
*js.Object
}
type Uniform struct {
*js.Object
}
var NoAttrib Attrib
var NoProgram Program
var NoShader Shader
var NoBuffer Buffer
var NoFramebuffer Framebuffer
var NoRenderbuffer Renderbuffer
var NoTexture Texture
var NoUniform Uniform
// Object is a generic interface for OpenGL objects
type Object interface {
Identifier() Enum
Name() *js.Object
}
// Implement Name() for the Object interface
func (p Program) Name() *js.Object {
return p.Object
}
func (s Shader) Name() *js.Object {
return s.Object
}
func (b Buffer) Name() *js.Object {
return b.Object
}
func (fb Framebuffer) Name() *js.Object {
return fb.Object
}
func (rb Renderbuffer) Name() *js.Object {
return rb.Object
}
func (t Texture) Name() *js.Object {
return t.Object
}