Now that we have this public LoadFromString, and you removed the default constructor, how should we go about using it without loading a shader from somewhere else first? :wink:
From what it looks like, the LoadFromString was never added since there was already a public constructor using a string (for loading from file). Maybe LoadFromString can be introduced as a public static method:
public static Shader FromString(string shader)
{
return new Shader(sfShader_CreateFromMemory(shader));
}
Shader(IntPtr shader) : base(shader)
{
if (This == IntPtr.Zero)
throw new LoadingFailedException("shader");
}
Its a pretty common approach in .NET for when you have multiple constructors with very similar (or identical) parameters, but the way the parameters are used are very different.