public IShaderCache AddShaderPath(string path) { _shaderPaths.Add(path); var watcher = new FileSystemWatcher(path); //_watcher.Filters.Add("*.frag"); //_watcher.Filters.Add("*.vert"); watcher.Changed += (sender, e) => ShadersUpdated?.Invoke(sender, new EventArgs()); watcher.EnableRaisingEvents = true; _watchers.Add(watcher); return(this); }
public ShaderCache(string debugShaderPath, string shaderCachePath) { _debugShaderPath = debugShaderPath; _shaderCachePath = shaderCachePath; if (!Directory.Exists(shaderCachePath)) { Directory.CreateDirectory(shaderCachePath); } _watcher = new FileSystemWatcher(debugShaderPath); //_watcher.Filters.Add("*.frag"); //_watcher.Filters.Add("*.vert"); _watcher.Changed += (sender, e) => ShadersUpdated?.Invoke(sender, new EventArgs()); _watcher.EnableRaisingEvents = true; }