mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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() {
|
||||
id, err = u.graphicsDevice.CreateTexture(img)
|
||||
})
|
||||
if u.textureFactoryEvents == nil {
|
||||
return
|
||||
}
|
||||
e := graphics.TextureCreatedEvent{
|
||||
Tag: tag,
|
||||
Id: id,
|
||||
@ -86,6 +89,9 @@ func (u *cocoaUI) CreateRenderTarget(tag interface{}, width, height int) {
|
||||
u.textureFactory.useGLContext(func() {
|
||||
id, err = u.graphicsDevice.CreateRenderTarget(width, height)
|
||||
})
|
||||
if u.textureFactoryEvents == nil {
|
||||
return
|
||||
}
|
||||
e := graphics.RenderTargetCreatedEvent{
|
||||
Tag: tag,
|
||||
Id: id,
|
||||
|
Loading…
Reference in New Issue
Block a user