mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 03:02:49 +01:00
opengl: Remove invalidFramebuffer and use nil instead
This commit is contained in:
parent
1154fcf470
commit
f85c846596
@ -51,8 +51,7 @@ type attribLocation int
|
|||||||
type programID int
|
type programID int
|
||||||
|
|
||||||
var (
|
var (
|
||||||
invalidTexture = Texture{}
|
invalidTexture = Texture{}
|
||||||
invalidFramebuffer = Framebuffer(nil)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func getProgramID(p Program) programID {
|
func getProgramID(p Program) programID {
|
||||||
@ -120,7 +119,7 @@ func Init() error {
|
|||||||
func (c *Context) Reset() error {
|
func (c *Context) Reset() error {
|
||||||
c.locationCache = newLocationCache()
|
c.locationCache = newLocationCache()
|
||||||
c.lastTexture = invalidTexture
|
c.lastTexture = invalidTexture
|
||||||
c.lastFramebuffer = invalidFramebuffer
|
c.lastFramebuffer = nil
|
||||||
c.lastViewportWidth = 0
|
c.lastViewportWidth = 0
|
||||||
c.lastViewportHeight = 0
|
c.lastViewportHeight = 0
|
||||||
c.lastCompositeMode = CompositeModeUnknown
|
c.lastCompositeMode = CompositeModeUnknown
|
||||||
@ -255,7 +254,7 @@ func (c *Context) DeleteFramebuffer(f Framebuffer) {
|
|||||||
// will be a default framebuffer.
|
// will be a default framebuffer.
|
||||||
// https://www.khronos.org/opengles/sdk/docs/man/xhtml/glDeleteFramebuffers.xml
|
// https://www.khronos.org/opengles/sdk/docs/man/xhtml/glDeleteFramebuffers.xml
|
||||||
if c.lastFramebuffer == f {
|
if c.lastFramebuffer == f {
|
||||||
c.lastFramebuffer = invalidFramebuffer
|
c.lastFramebuffer = nil
|
||||||
c.lastViewportWidth = 0
|
c.lastViewportWidth = 0
|
||||||
c.lastViewportHeight = 0
|
c.lastViewportHeight = 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user