public void RegisterSurface(Surface surface, Entity entity, GameObject go) { var surfaceApi = new SurfaceApi(surface, entity, this); _tableApi.Surfaces[surface.Name] = surfaceApi; _initializables.Add(surfaceApi); _hittables[entity] = surfaceApi; _slingshots[entity] = surfaceApi; }
public unsafe void Dispose() { CommandBufferPool.Dispose(); _counters.Dispose(); _window.Dispose(); HelperShader.Dispose(); _pipeline.Dispose(); BufferManager.Dispose(); DescriptorSetManager.Dispose(); PipelineLayoutCache.Dispose(); SurfaceApi.DestroySurface(_instance, _surface, null); MemoryAllocator.Dispose(); if (_debugReportCallback.Handle != 0) { DebugReportApi.DestroyDebugReportCallback(_instance, _debugReportCallback, null); } foreach (var shader in Shaders) { shader.Dispose(); } foreach (var texture in Textures) { texture.Release(); } foreach (var sampler in Samplers) { sampler.Dispose(); } Api.DestroyDevice(_device, null); // Last step destroy the instance Api.DestroyInstance(_instance, null); }