FS#145 - Implement copy constructors and ToString functions in SFML.Net
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1330 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
bd9a60fef2
commit
dd255a916d
28 changed files with 627 additions and 0 deletions
|
@ -41,6 +41,19 @@ namespace SFML
|
|||
throw new LoadingFailedException("shader", filename);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Construct the shader from another shader
|
||||
/// </summary>
|
||||
/// <param name="copy">Shader to copy</param>
|
||||
////////////////////////////////////////////////////////////
|
||||
public Shader(Shader copy) :
|
||||
base(sfShader_Copy(copy.This))
|
||||
{
|
||||
foreach (KeyValuePair<string, Image> pair in copy.myTextures)
|
||||
myTextures[pair.Key] = copy.myTextures[pair.Key];
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Load the shader from a text in memory
|
||||
|
@ -175,6 +188,17 @@ namespace SFML
|
|||
get {return null;}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Provide a string describing the object
|
||||
/// </summary>
|
||||
/// <returns>String description of the object</returns>
|
||||
////////////////////////////////////////////////////////////
|
||||
public override string ToString()
|
||||
{
|
||||
return "[Shader]";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <summary>
|
||||
/// Handle the destruction of the object
|
||||
|
@ -205,6 +229,9 @@ namespace SFML
|
|||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfShader_CreateFromMemory(string Shader);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfShader_Copy(IntPtr Shader);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern void sfShader_Destroy(IntPtr Shader);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue