+ WPF Support
This commit is contained in:
parent
6f23a80f7f
commit
41421b1df9
12 changed files with 94 additions and 14 deletions
|
|
@ -82,6 +82,12 @@ namespace SM.OGL.Shaders
|
|||
/// <inheritdoc />
|
||||
public override ObjectLabelIdentifier TypeIdentifier { get; } = ObjectLabelIdentifier.Program;
|
||||
|
||||
public void Update(ShaderFileCollection newShaderFiles)
|
||||
{
|
||||
ShaderFileFiles = newShaderFiles;
|
||||
Recompile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the shader to the GPU.
|
||||
/// </summary>
|
||||
|
|
@ -106,6 +112,11 @@ namespace SM.OGL.Shaders
|
|||
Load();
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
GL.DeleteShader(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the mesh.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ namespace SM.OGL.Shaders
|
|||
{
|
||||
var name =
|
||||
$"{prefix}{Path.GetFileNameWithoutExtension(filePath.Substring(path.Length)).Replace('.', '_')}";
|
||||
|
||||
if (Extensions.ContainsKey(name)) continue;
|
||||
|
||||
Extensions.Add(name, new ShaderFile(reader.ReadToEnd()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ namespace SM.OGL.Shaders
|
|||
foreach (var kvp in StringOverrides)
|
||||
_data = _data.Replace("//!" + kvp.Key, kvp.Value);
|
||||
}
|
||||
|
||||
|
||||
internal void Compile(GenericShader shader, ShaderType type)
|
||||
{
|
||||
if (_id < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue