mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Renamed Shader.LoadFromFile to FromFile and made it static (so that now it is a named constructor), in SFML.Net
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1783 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
f3b1cfd0de
commit
f7427fe167
@ -43,17 +43,18 @@ namespace SFML
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Load the shader from a text in memory
|
||||
/// Create a new shader from a text in memory
|
||||
/// </summary>
|
||||
/// <param name="shader">String containing the shader code</param>
|
||||
/// <exception cref="LoadingFailedException" />
|
||||
////////////////////////////////////////////////////////////
|
||||
public void LoadFromString(string shader)
|
||||
public static Shader FromString(string shader)
|
||||
{
|
||||
SetThis(sfShader_CreateFromMemory(shader));
|
||||
|
||||
if (This == IntPtr.Zero)
|
||||
IntPtr ptr = sfShader_CreateFromMemory(shader);
|
||||
if (ptr == IntPtr.Zero)
|
||||
throw new LoadingFailedException("shader");
|
||||
|
||||
return new Shader(ptr);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@ -204,6 +205,17 @@ namespace SFML
|
||||
Context.Global.SetActive(false);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Construct the shader from a pointer
|
||||
/// </summary>
|
||||
/// <param name="ptr">Pointer to the shader instance</param>
|
||||
////////////////////////////////////////////////////////////
|
||||
public Shader(IntPtr ptr) :
|
||||
base(ptr)
|
||||
{
|
||||
}
|
||||
|
||||
Dictionary<string, Image> myTextures = new Dictionary<string, Image>();
|
||||
|
||||
#region Imports
|
||||
|
Loading…
Reference in New Issue
Block a user