mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-03 22:44:28 +01:00
Bug fix: check ui.textureFactoryEvent exists
This commit is contained in:
parent
94ecfbba9c
commit
099ab48382
@ -70,6 +70,9 @@ func (u *cocoaUI) CreateTexture(tag interface{}, img image.Image) {
|
|||||||
u.textureFactory.useGLContext(func() {
|
u.textureFactory.useGLContext(func() {
|
||||||
id, err = u.graphicsDevice.CreateTexture(img)
|
id, err = u.graphicsDevice.CreateTexture(img)
|
||||||
})
|
})
|
||||||
|
if u.textureFactoryEvents == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
e := graphics.TextureCreatedEvent{
|
e := graphics.TextureCreatedEvent{
|
||||||
Tag: tag,
|
Tag: tag,
|
||||||
Id: id,
|
Id: id,
|
||||||
@ -86,6 +89,9 @@ func (u *cocoaUI) CreateRenderTarget(tag interface{}, width, height int) {
|
|||||||
u.textureFactory.useGLContext(func() {
|
u.textureFactory.useGLContext(func() {
|
||||||
id, err = u.graphicsDevice.CreateRenderTarget(width, height)
|
id, err = u.graphicsDevice.CreateRenderTarget(width, height)
|
||||||
})
|
})
|
||||||
|
if u.textureFactoryEvents == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
e := graphics.RenderTargetCreatedEvent{
|
e := graphics.RenderTargetCreatedEvent{
|
||||||
Tag: tag,
|
Tag: tag,
|
||||||
Id: id,
|
Id: id,
|
||||||
|
Loading…
Reference in New Issue
Block a user