mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
parent
865523048d
commit
c44accbfb5
@ -152,3 +152,7 @@ func (md MetalDrawable) Drawable() unsafe.Pointer { return md.metalDrawable }
|
|||||||
func (md MetalDrawable) Texture() mtl.Texture {
|
func (md MetalDrawable) Texture() mtl.Texture {
|
||||||
return mtl.NewTexture(C.MetalDrawable_Texture(md.metalDrawable))
|
return mtl.NewTexture(C.MetalDrawable_Texture(md.metalDrawable))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (md MetalDrawable) Release() {
|
||||||
|
C.MetalDrawable_Release(md.metalDrawable)
|
||||||
|
}
|
||||||
|
@ -31,3 +31,4 @@ void MetalLayer_SetDrawableSize(void *metalLayer, double width, double height);
|
|||||||
void *MetalLayer_NextDrawable(void *metalLayer);
|
void *MetalLayer_NextDrawable(void *metalLayer);
|
||||||
|
|
||||||
void *MetalDrawable_Texture(void *drawable);
|
void *MetalDrawable_Texture(void *drawable);
|
||||||
|
void MetalDrawable_Release(void *drawable);
|
||||||
|
@ -89,3 +89,7 @@ void *MetalLayer_NextDrawable(void *metalLayer) {
|
|||||||
void *MetalDrawable_Texture(void *metalDrawable) {
|
void *MetalDrawable_Texture(void *metalDrawable) {
|
||||||
return ((id<CAMetalDrawable>)metalDrawable).texture;
|
return ((id<CAMetalDrawable>)metalDrawable).texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MetalDrawable_Release(void *metalDrawable) {
|
||||||
|
[(id<CAMetalDrawable>)metalDrawable release];
|
||||||
|
}
|
||||||
|
@ -598,6 +598,7 @@ func (d *Driver) Draw(indexLen int, indexOffset int, mode graphics.CompositeMode
|
|||||||
}
|
}
|
||||||
t = d.screenDrawable.Texture()
|
t = d.screenDrawable.Texture()
|
||||||
} else {
|
} else {
|
||||||
|
d.screenDrawable.Release()
|
||||||
d.screenDrawable = ca.MetalDrawable{}
|
d.screenDrawable = ca.MetalDrawable{}
|
||||||
t = d.dst.texture
|
t = d.dst.texture
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user