public void Dispose() { if (_context != EAGLContext.CurrentContext) { throw new InvalidOperationException("Associated EAGLContext is not current"); } _fbo?.Dispose(); _fbo = null; }
public bool Sync() { if (_fbo != null && _oldLayerWidth == _layer.Bounds.Width && _oldLayerHeight == _layer.Bounds.Height && _oldLayerScale == _layer.ContentsScale) { return(true); } _fbo?.Dispose(); _fbo = null; _fbo = LayerFbo.TryCreate(_context, _gl, _layer); _oldLayerWidth = _layer.Bounds.Width; _oldLayerHeight = _layer.Bounds.Height; _oldLayerScale = _layer.ContentsScale; return(_fbo != null); }