public void Delete(ShaderPack pack) { if (_enabledPack == pack) { _enabledPack = null; } Packs.Remove(pack); _shaderPackService.DeleteFromDisk(pack); }
public ShaderPackViewModel( GamePathService gamePathService, ShaderPackService shaderPackService, LanguageService languageService) { _gamePathService = gamePathService; _shaderPackService = shaderPackService; _languageService = languageService; Packs = new BindableCollection <ShaderPack>(); _enabledPack = null; }
public ShaderPool() { DepthOnly = new ShaderPack("ConeLight.fragment.glsl"); GenericMaterial = new ShaderPack("Generic.fragment.glsl"); ForwardMaterial = new ShaderPack("Forward.fragment.glsl"); NoFragment = new ShaderPack(); Packs = new ShaderPack[] { DepthOnly, GenericMaterial, ForwardMaterial, NoFragment }; }
public async void Reload() { Packs.Clear(); foreach (var pack in await _shaderPackService.LoadAllAsync()) { if (pack.IsEnabled) { _enabledPack = pack; } Packs.Add(pack); } }
public DrawCommand(string text, Vector2 position, Color color, float scale = 0.5f, int maxlife = -1, ShaderPack?shaderPack = null, float layerDepth = 0) { this.type = DrawType.drawString; this.position = position; this.color = color; this.permColor = color; this.layerDepth = layerDepth; this.scale = scale; this.text = text; this.maxlife = maxlife; this.life = maxlife; this.shaderPack = shaderPack ?? ShaderPack.Default; }
public void OnEnableStatusChanged(ShaderPack pack) { if (pack.IsEnabled) { if (_enabledPack != null) { _enabledPack.IsEnabled = false; } _enabledPack = pack; } else if (pack == _enabledPack) { _enabledPack = null; } NotifyOfPropertyChange(nameof(Packs)); }
public DrawCommand(Textures texture, Vector2 position, Rectangle?sourceRect, Color color, float rotation, Vector2 origin, Vector2 scalevect, float layerDepth = 0, int maxlife = -1, ShaderPack?shaderPack = null) { this.type = DrawType.vectScaled; this.texture = texture; this.position = position; this.color = color; this.permColor = color; this.scalevect = scalevect; this.rotation = rotation; this.sourceRect = sourceRect; this.origin = origin; this.layerDepth = layerDepth; this.maxlife = maxlife; this.life = maxlife; this.shaderPack = shaderPack ?? new ShaderPack(color); }
public DrawCommand(Texture2D texture, Vector2 position, Rectangle?sourceRect, Color color, float rotation, Vector2 origin, float scale, float layerDepth = 0, int maxlife = -1, ShaderPack?shaderPack = null) { this.type = DrawType.direct; this.texture2d = texture; this.position = position; this.color = color; this.permColor = color; this.scale = scale; this.rotation = rotation; this.sourceRect = sourceRect; this.origin = origin; this.layerDepth = layerDepth; this.maxlife = maxlife; this.life = maxlife; this.shaderPack = shaderPack ?? ShaderPack.Default; }
public void Enable(ShaderPack pack) { pack.IsEnabled = true; OnEnableStatusChanged(pack); }
public ShaderPool() { DepthOnly = new ShaderPack(); GenericMaterial = new ShaderPack("Generic.fragment.glsl"); DistanceOnly = new ShaderPack("DistanceOnly.fragment.glsl"); }