diff --git a/internal/driver/graphics.go b/internal/driver/graphics.go index 8fcc744ef..7c6bc1ac8 100644 --- a/internal/driver/graphics.go +++ b/internal/driver/graphics.go @@ -30,8 +30,8 @@ type Region struct { } const ( - InvalidImageID = -1 - InvalidShaderID = -1 + InvalidImageID = 0 + InvalidShaderID = 0 ) type Graphics interface { diff --git a/internal/graphicsdriver/metal/graphics.go b/internal/graphicsdriver/metal/graphics.go index 9e016d5b2..be86f7c7a 100644 --- a/internal/graphicsdriver/metal/graphics.go +++ b/internal/graphicsdriver/metal/graphics.go @@ -408,15 +408,13 @@ func (g *Graphics) checkSize(width, height int) { } func (g *Graphics) genNextImageID() driver.ImageID { - id := g.nextImageID g.nextImageID++ - return id + return g.nextImageID } func (g *Graphics) genNextShaderID() driver.ShaderID { - id := g.nextShaderID g.nextShaderID++ - return id + return g.nextShaderID } func (g *Graphics) NewImage(width, height int) (driver.Image, error) { diff --git a/internal/graphicsdriver/opengl/graphics.go b/internal/graphicsdriver/opengl/graphics.go index 8ed7de348..da0ccc01f 100644 --- a/internal/graphicsdriver/opengl/graphics.go +++ b/internal/graphicsdriver/opengl/graphics.go @@ -74,15 +74,13 @@ func (g *Graphics) checkSize(width, height int) { } func (g *Graphics) genNextImageID() driver.ImageID { - id := g.nextImageID g.nextImageID++ - return id + return g.nextImageID } func (g *Graphics) genNextShaderID() driver.ShaderID { - id := g.nextShaderID g.nextShaderID++ - return id + return g.nextShaderID } func (g *Graphics) NewImage(width, height int) (driver.Image, error) {