mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user