internal void RegisterDeviceResource(IEngineDeviceResource resource)
        {
            var currentDeviceResourceIndex = resource.GetDeviceResourceIndex(_device);

            currentDeviceResourceIndex.EnsureNegativeAndNotZero(nameof(currentDeviceResourceIndex));

            _deviceResources.Add(resource);
            resource.SetDeviceResourceIndex(_device, _deviceResources.Count - 1);
        }
        internal void DeregisterDeviceResource(IEngineDeviceResource resource)
        {
            var currentDeviceResourceIndex = resource.GetDeviceResourceIndex(_device);

            currentDeviceResourceIndex.EnsurePositiveOrZero(nameof(currentDeviceResourceIndex));

            _deviceResources[currentDeviceResourceIndex] = null;
            resource.SetDeviceResourceIndex(_device, -1);

            _cleanupNeeded = true;
        }
示例#3
0
 public void DeregisterDeviceResource(IEngineDeviceResource resource)
 {
     _host.DeregisterDeviceResource(resource);
 }