ui/app: make opengl objects structs

WebGL use opaque values for object handles, not integers. To ensure
portability, wrap handle types with a struct.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-05-04 13:41:55 +02:00
parent 2af0f63cfb
commit 8df5feeeea
11 changed files with 133 additions and 121 deletions
+2 -2
View File
@@ -326,7 +326,7 @@ func (g *GPU) setErr(err error) {
}
func (r *renderer) texHandle(t *texture) gl.Texture {
if t.id != 0 {
if t.id != (gl.Texture{}) {
return t.id
}
t.id = createTexture(r.ctx)
@@ -336,7 +336,7 @@ func (r *renderer) texHandle(t *texture) gl.Texture {
}
func (t *texture) release(ctx *gl.Functions) {
if t.id != 0 {
if t.id != (gl.Texture{}) {
ctx.DeleteTexture(t.id)
}
}