()
| 335 | } |
| 336 | |
| 337 | func (sf *Surface) Destroy() { |
| 338 | sf.FreeSwapchain() |
| 339 | if sf.Surface != vk.NullSurface { |
| 340 | vk.DestroySurface(sf.GPU.Instance, sf.Surface, nil) |
| 341 | sf.Surface = vk.NullSurface |
| 342 | } |
| 343 | sf.Device.Destroy() |
| 344 | sf.GPU = nil |
| 345 | } |
| 346 | |
| 347 | // AcquireNextImage gets the next frame index to render to. |
| 348 | // It automatically handles any issues with out-of-date swapchain. |