gpu/internal/opengl,app/internal/wm: generalize desktop OpenGL support

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>
This commit is contained in:
Elias Naur
2021-06-01 17:47:13 +02:00
parent c21897620b
commit 476d2269a6
9 changed files with 98 additions and 102 deletions
+5
View File
@@ -11,6 +11,7 @@ type (
Texture struct{ V uint }
Query struct{ V uint }
Uniform struct{ V int }
VertexArray struct{ V uint }
Object struct{ V uint }
)
@@ -29,3 +30,7 @@ func (p Program) Valid() bool {
func (s Shader) Valid() bool {
return s.V != 0
}
func (a VertexArray) Valid() bool {
return a.V != 0
}