mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
opengl: Initialize lastTexture
This commit is contained in:
parent
275fc66f06
commit
d8e7ec5274
@ -37,7 +37,10 @@ type attribLocation int32
|
|||||||
|
|
||||||
type programID uint32
|
type programID uint32
|
||||||
|
|
||||||
const invalidFramebuffer = (1 << 32) - 1
|
const (
|
||||||
|
invalidTexture = 0
|
||||||
|
invalidFramebuffer = (1 << 32) - 1
|
||||||
|
)
|
||||||
|
|
||||||
func (p Program) id() programID {
|
func (p Program) id() programID {
|
||||||
return programID(p)
|
return programID(p)
|
||||||
@ -106,6 +109,7 @@ func (c *Context) Reset() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
c.locationCache = newLocationCache()
|
c.locationCache = newLocationCache()
|
||||||
|
c.lastTexture = invalidTexture
|
||||||
c.lastFramebuffer = invalidFramebuffer
|
c.lastFramebuffer = invalidFramebuffer
|
||||||
c.lastViewportWidth = 0
|
c.lastViewportWidth = 0
|
||||||
c.lastViewportHeight = 0
|
c.lastViewportHeight = 0
|
||||||
|
@ -52,7 +52,10 @@ type attribLocation int
|
|||||||
|
|
||||||
type programID int
|
type programID int
|
||||||
|
|
||||||
var invalidFramebuffer = Framebuffer{nil}
|
var (
|
||||||
|
invalidTexture = Texture{}
|
||||||
|
invalidFramebuffer = Framebuffer{}
|
||||||
|
)
|
||||||
|
|
||||||
func (p Program) id() programID {
|
func (p Program) id() programID {
|
||||||
return programID(p.Get("__ebiten_programId").Int())
|
return programID(p.Get("__ebiten_programId").Int())
|
||||||
@ -115,6 +118,7 @@ func NewContext() (*Context, error) {
|
|||||||
|
|
||||||
func (c *Context) Reset() error {
|
func (c *Context) Reset() error {
|
||||||
c.locationCache = newLocationCache()
|
c.locationCache = newLocationCache()
|
||||||
|
c.lastTexture = invalidTexture
|
||||||
c.lastFramebuffer = invalidFramebuffer
|
c.lastFramebuffer = invalidFramebuffer
|
||||||
c.lastViewportWidth = 0
|
c.lastViewportWidth = 0
|
||||||
c.lastViewportHeight = 0
|
c.lastViewportHeight = 0
|
||||||
|
@ -34,7 +34,10 @@ type attribLocation mgl.Attrib
|
|||||||
|
|
||||||
type programID uint32
|
type programID uint32
|
||||||
|
|
||||||
var invalidFramebuffer = Framebuffer(mgl.Framebuffer{(1 << 32) - 1})
|
var (
|
||||||
|
invalidTexture = Texture(mgl.Texture{})
|
||||||
|
invalidFramebuffer = Framebuffer(mgl.Framebuffer{(1 << 32) - 1})
|
||||||
|
)
|
||||||
|
|
||||||
func (p Program) id() programID {
|
func (p Program) id() programID {
|
||||||
return programID(p.Value)
|
return programID(p.Value)
|
||||||
@ -93,6 +96,7 @@ loop:
|
|||||||
|
|
||||||
func (c *Context) Reset() error {
|
func (c *Context) Reset() error {
|
||||||
c.locationCache = newLocationCache()
|
c.locationCache = newLocationCache()
|
||||||
|
c.lastTexture = invalidTexture
|
||||||
c.lastFramebuffer = invalidFramebuffer
|
c.lastFramebuffer = invalidFramebuffer
|
||||||
c.lastViewportWidth = 0
|
c.lastViewportWidth = 0
|
||||||
c.lastViewportHeight = 0
|
c.lastViewportHeight = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user