Engine_silk.NET/Nebulix/Rendering/Shaders/ShaderCompileException.cs

28 lines
959 B
C#
Raw Normal View History

2023-09-28 13:40:20 +02:00
using Silk.NET.OpenGL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Nebulix.Rendering;
2023-09-28 13:40:20 +02:00
[Serializable]
public class ShaderCompileException : Exception
{
protected ShaderType _shaderType;
public ShaderCompileException(ShaderType shaderType) : base("Unable to compile shader.") { _shaderType = shaderType; }
public ShaderCompileException(ShaderType shaderType, string message) : base(message) { _shaderType = shaderType; }
public ShaderCompileException(ShaderType shaderType, string message, Exception inner) : base(message, inner) { _shaderType = shaderType; }
protected ShaderCompileException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
public override string ToString()
{
return $"Type of Shader: '{_shaderType}'" + "\n" + Message;
}
}