mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
476d2269a6
This changes moves the macOS specific setup for desktop OpenGL to the portable opengl package. The opengl package already takes care of the desktop OpenGL setup for sRGB framebuffers, and by moving the code we avoid calling the wrong OpenGL functions in case both OpenGL.framework and ANGLE libGLESv2.dylib is linked into the program. Remove the interface casting expressions for gl.Functions; it wasn't worth the trouble to keep updated. Signed-off-by: Elias Naur <mail@eliasnaur.com>
37 lines
613 B
Go
37 lines
613 B
Go
// +build !js
|
|
|
|
package gl
|
|
|
|
type (
|
|
Buffer struct{ V uint }
|
|
Framebuffer struct{ V uint }
|
|
Program struct{ V uint }
|
|
Renderbuffer struct{ V uint }
|
|
Shader struct{ V uint }
|
|
Texture struct{ V uint }
|
|
Query struct{ V uint }
|
|
Uniform struct{ V int }
|
|
VertexArray struct{ V uint }
|
|
Object struct{ V uint }
|
|
)
|
|
|
|
func (u Framebuffer) Valid() bool {
|
|
return u.V != 0
|
|
}
|
|
|
|
func (u Uniform) Valid() bool {
|
|
return u.V != -1
|
|
}
|
|
|
|
func (p Program) Valid() bool {
|
|
return p.V != 0
|
|
}
|
|
|
|
func (s Shader) Valid() bool {
|
|
return s.V != 0
|
|
}
|
|
|
|
func (a VertexArray) Valid() bool {
|
|
return a.V != 0
|
|
}
|