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:
LaurentGom 2010-01-06 12:37:29 +00:00
parent bd9a60fef2
commit dd255a916d
28 changed files with 627 additions and 0 deletions

View file

@ -49,6 +49,17 @@ namespace SFML
this.Size = size;
}
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the view from another view
/// </summary>
/// <param name="copy">View to copy</param>
////////////////////////////////////////////////////////////
public View(View copy) :
base(sfView_Copy(copy.This))
{
}
////////////////////////////////////////////////////////////
/// <summary>
/// Center of the view
@ -138,6 +149,21 @@ namespace SFML
sfView_Zoom(This, factor);
}
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[View]" +
" Center = " + Center +
" Size = " + Size +
" Rotation = " + Rotation +
" Viewport = " + Viewport;
}
////////////////////////////////////////////////////////////
/// <summary>
/// Internal constructor for other classes which need to manipulate raw views
@ -167,6 +193,9 @@ namespace SFML
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfView_CreateFromRect(FloatRect Rect);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfView_Copy(IntPtr View);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern void sfView_Destroy(IntPtr View);