Пример #1
0
 public ITextureHandle GetWritableCubeMapHandleFromTexture(WritableCubeMap texture)
 {
     if (!_identifierToTextureHandleDictionary.TryGetValue(texture.SessionUniqueIdentifier, out var foundTextureHandle))
     {
         return(RegisterNewTexture(texture));
     }
     return(foundTextureHandle);
 }
Пример #2
0
        private ITextureHandle RegisterNewTexture(WritableCubeMap texture)
        {
            // Configure newly created TextureHandle to reflect Texture's properties on GPU (allocate buffers)
            ITextureHandle textureHandle = _renderContextImp.CreateTexture(texture);

            // Setup handler to observe changes of the texture data and dispose event (deallocation)
            texture.TextureChanged += TextureChanged;

            _identifierToTextureHandleDictionary.Add(texture.SessionUniqueIdentifier, textureHandle);

            return(textureHandle);
        }