mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/graphicsdriver/opengl: remove unused variables
It should be safe to assume 0 is an invalid texture ID in OpenGL. https://registry.khronos.org/OpenGL-Refpages/gl4/html/glIsTexture.xhtml > If texture is zero, or is a non-zero value that is not currently the > name of a texture, or if an error occurs, glIsTexture returns GL_FALSE.
This commit is contained in:
parent
de3702e4c2
commit
f08983e14d
@ -71,8 +71,6 @@ func (p program) equal(rhs program) bool {
|
||||
return p.value.Equal(rhs.value) && p.id == rhs.id
|
||||
}
|
||||
|
||||
var InvalidTexture = textureNative(js.Null())
|
||||
|
||||
var invalidUniform = uniformLocation(js.Null())
|
||||
|
||||
func getProgramID(p program) programID {
|
||||
|
@ -59,8 +59,6 @@ func (p program) equal(rhs program) bool {
|
||||
return p == rhs
|
||||
}
|
||||
|
||||
var InvalidTexture textureNative
|
||||
|
||||
type (
|
||||
uniformLocation int32
|
||||
attribLocation int32
|
||||
@ -73,7 +71,6 @@ func (u uniformLocation) equal(rhs uniformLocation) bool {
|
||||
type programID uint32
|
||||
|
||||
const (
|
||||
invalidTexture = 0
|
||||
invalidFramebuffer = (1 << 32) - 1
|
||||
invalidUniform = -1
|
||||
)
|
||||
@ -97,7 +94,7 @@ func (c *context) reset() error {
|
||||
}
|
||||
|
||||
c.locationCache = newLocationCache()
|
||||
c.lastTexture = invalidTexture
|
||||
c.lastTexture = 0
|
||||
c.lastFramebuffer = invalidFramebuffer
|
||||
c.lastViewportWidth = 0
|
||||
c.lastViewportHeight = 0
|
||||
@ -183,7 +180,7 @@ func (c *context) deleteTexture(t textureNative) {
|
||||
return
|
||||
}
|
||||
if c.lastTexture == t {
|
||||
c.lastTexture = invalidTexture
|
||||
c.lastTexture = 0
|
||||
}
|
||||
c.ctx.DeleteTexture(uint32(t))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user