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

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -215,6 +215,29 @@ namespace SFML
set {sfMusic_SetPlayingOffset(This, value);} set {sfMusic_SetPlayingOffset(This, value);}
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Music]" +
" SampleRate = " + SampleRate +
" ChannelsCount = " + ChannelsCount +
" Status = " + Status +
" Duration = " + Duration +
" Loop = " + Loop +
" Pitch = " + Pitch +
" Volume = " + Volume +
" Position = " + Position +
" RelativeToListener = " + RelativeToListener +
" MinDistance = " + MinDistance +
" Attenuation = " + Attenuation +
" PlayingOffset = " + PlayingOffset;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Handle the destruction of the object /// Handle the destruction of the object

View File

@ -53,6 +53,18 @@ namespace SFML
SoundBuffer = buffer; SoundBuffer = buffer;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the sound from another source
/// </summary>
/// <param name="copy">Sound to copy</param>
////////////////////////////////////////////////////////////
public Sound(Sound copy) :
base(sfSound_Copy(copy.This))
{
SoundBuffer = copy.SoundBuffer;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Play the sound /// Play the sound
@ -198,6 +210,27 @@ namespace SFML
set {sfSound_SetAttenuation(This, value);} set {sfSound_SetAttenuation(This, value);}
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Sound]" +
" Status = " + Status +
" Loop = " + Loop +
" Pitch = " + Pitch +
" Volume = " + Volume +
" Position = " + Position +
" RelativeToListener = " + RelativeToListener +
" MinDistance = " + MinDistance +
" Attenuation = " + Attenuation +
" PlayingOffset = " + PlayingOffset +
" SoundBuffer = " + SoundBuffer;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Handle the destruction of the object /// Handle the destruction of the object
@ -215,6 +248,9 @@ namespace SFML
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfSound_Create(); static extern IntPtr sfSound_Create();
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfSound_Copy(IntPtr Sound);
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
static extern void sfSound_Destroy(IntPtr Sound); static extern void sfSound_Destroy(IntPtr Sound);

View File

@ -77,6 +77,17 @@ namespace SFML
throw new LoadingFailedException("sound buffer"); throw new LoadingFailedException("sound buffer");
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the sound buffer from another sound buffer
/// </summary>
/// <param name="copy">Sound buffer to copy</param>
////////////////////////////////////////////////////////////
public SoundBuffer(SoundBuffer copy) :
base(sfSoundBuffer_Copy(copy.This))
{
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Save the sound buffer to an audio file /// Save the sound buffer to an audio file
@ -134,6 +145,20 @@ namespace SFML
} }
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[SoundBuffer]" +
" SampleRate = " + SampleRate +
" ChannelsCount = " + ChannelsCount +
" Duration = " + Duration;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Handle the destruction of the object /// Handle the destruction of the object
@ -155,6 +180,9 @@ namespace SFML
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
unsafe static extern IntPtr sfSoundBuffer_CreateFromSamples(short* Samples, uint SamplesCount, uint ChannelsCount, uint SampleRate); unsafe static extern IntPtr sfSoundBuffer_CreateFromSamples(short* Samples, uint SamplesCount, uint ChannelsCount, uint SampleRate);
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfSoundBuffer_Copy(IntPtr SoundBuffer);
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
static extern void sfSoundBuffer_Destroy(IntPtr SoundBuffer); static extern void sfSoundBuffer_Destroy(IntPtr SoundBuffer);

View File

@ -28,6 +28,19 @@ namespace SFML
} }
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[SoundBufferRecorder]" +
" SampleRate = " + SampleRate +
" SoundBuffer = " + SoundBuffer;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Called when a new capture starts /// Called when a new capture starts

View File

@ -83,6 +83,18 @@ namespace SFML
get {return sfSoundRecorder_IsAvailable();} get {return sfSoundRecorder_IsAvailable();}
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[SoundRecorder]" +
" SampleRate = " + SampleRate;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Called when a new capture starts /// Called when a new capture starts

View File

@ -180,6 +180,28 @@ namespace SFML
set {sfSoundStream_SetPlayingOffset(This, value);} set {sfSoundStream_SetPlayingOffset(This, value);}
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[SoundStream]" +
" SampleRate = " + SampleRate +
" ChannelsCount = " + ChannelsCount +
" Status = " + Status +
" Loop = " + Loop +
" Pitch = " + Pitch +
" Volume = " + Volume +
" Position = " + Position +
" RelativeToListener = " + RelativeToListener +
" MinDistance = " + MinDistance +
" Attenuation = " + Attenuation +
" PlayingOffset = " + PlayingOffset;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Set the audio stream parameters, you must call it before Play() /// Set the audio stream parameters, you must call it before Play()

View File

@ -106,6 +106,20 @@ namespace SFML
return new Vector3(v.X / x, v.Y / x, v.Z / x); return new Vector3(v.X / x, v.Y / x, v.Z / x);
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Vector3]" +
" X = " + X +
" Y = " + Y +
" Z = " + Z;
}
/// <summary>X (horizontal) component of the vector</summary> /// <summary>X (horizontal) component of the vector</summary>
public float X; public float X;

View File

@ -54,6 +54,21 @@ namespace SFML
{ {
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Color]" +
" R = " + R +
" G = " + G +
" B = " + B +
" A = " + A;
}
/// <summary>Red component of the color</summary> /// <summary>Red component of the color</summary>
public byte R; public byte R;

View File

@ -61,6 +61,17 @@ namespace SFML
} }
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Context]";
}
private static Context ourGlobalContext = null; private static Context ourGlobalContext = null;
private IntPtr myThis = IntPtr.Zero; private IntPtr myThis = IntPtr.Zero;

View File

@ -74,6 +74,17 @@ namespace SFML
throw new LoadingFailedException("font"); throw new LoadingFailedException("font");
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the font from another font
/// </summary>
/// <param name="copy">Font to copy</param>
////////////////////////////////////////////////////////////
public Font(Font copy) :
base(sfFont_Copy(copy.This))
{
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Get a glyph in the font /// Get a glyph in the font
@ -143,6 +154,17 @@ namespace SFML
} }
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Font]";
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Handle the destruction of the object /// Handle the destruction of the object
@ -190,6 +212,9 @@ namespace SFML
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
unsafe static extern IntPtr sfFont_CreateFromMemory(char* Data, uint SizeInBytes); unsafe static extern IntPtr sfFont_CreateFromMemory(char* Data, uint SizeInBytes);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfFont_Copy(IntPtr Font);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern void sfFont_Destroy(IntPtr This); static extern void sfFont_Destroy(IntPtr This);

View File

@ -120,6 +120,17 @@ namespace SFML
throw new LoadingFailedException("image"); throw new LoadingFailedException("image");
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the image from another image
/// </summary>
/// <param name="copy">Image to copy</param>
////////////////////////////////////////////////////////////
public Image(Image copy) :
base(sfImage_Copy(copy.This))
{
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Save the contents of the image to a file /// Save the contents of the image to a file
@ -297,6 +308,20 @@ namespace SFML
get {return sfImage_GetHeight(This);} get {return sfImage_GetHeight(This);}
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Image]" +
" Width = " + Width +
" Height = " + Height +
" Smooth = " + Smooth;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Internal constructor /// Internal constructor
@ -338,6 +363,9 @@ namespace SFML
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfImage_CreateFromFile(string Filename); static extern IntPtr sfImage_CreateFromFile(string Filename);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfImage_Copy(IntPtr Image);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
unsafe static extern IntPtr sfImage_CreateFromMemory(char* Data, uint Size); unsafe static extern IntPtr sfImage_CreateFromMemory(char* Data, uint Size);

View File

@ -125,6 +125,21 @@ namespace SFML
} }
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[IntRect]" +
" Left = " + Left +
" Top = " + Top +
" Right = " + Right +
" Bottom = " + Bottom;
}
/// <summary>Left coordinate of the rectangle</summary> /// <summary>Left coordinate of the rectangle</summary>
public int Left; public int Left;
@ -258,6 +273,21 @@ namespace SFML
} }
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[FloatRect]" +
" Left = " + Left +
" Top = " + Top +
" Right = " + Right +
" Bottom = " + Bottom;
}
/// <summary>Left coordinate of the rectangle</summary> /// <summary>Left coordinate of the rectangle</summary>
public float Left; public float Left;

View File

@ -242,6 +242,22 @@ namespace SFML
get {return sfRenderImage_IsAvailable();} get {return sfRenderImage_IsAvailable();}
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[RenderImage]" +
" Width = " + Width +
" Height = " + Height +
" Image = " + Image +
" DefaultView = " + DefaultView +
" CurrentView = " + CurrentView;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Handle the destruction of the object /// Handle the destruction of the object

View File

@ -425,6 +425,22 @@ namespace SFML
sfRenderWindow_Flush(This); sfRenderWindow_Flush(This);
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[RenderWindow]" +
" Width = " + Width +
" Height = " + Height +
" Settings = " + Settings +
" DefaultView = " + DefaultView +
" CurrentView = " + CurrentView;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Internal function to get the next event /// Internal function to get the next event

View File

@ -41,6 +41,19 @@ namespace SFML
throw new LoadingFailedException("shader", filename); 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> /// <summary>
/// Load the shader from a text in memory /// Load the shader from a text in memory
@ -175,6 +188,17 @@ namespace SFML
get {return null;} 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> /// <summary>
/// Handle the destruction of the object /// Handle the destruction of the object
@ -205,6 +229,9 @@ namespace SFML
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfShader_CreateFromMemory(string Shader); static extern IntPtr sfShader_CreateFromMemory(string Shader);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfShader_Copy(IntPtr Shader);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern void sfShader_Destroy(IntPtr Shader); static extern void sfShader_Destroy(IntPtr Shader);

View File

@ -25,6 +25,17 @@ namespace SFML
{ {
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the shape from another shape
/// </summary>
/// <param name="copy">Shape to copy</param>
////////////////////////////////////////////////////////////
public Shape(Shape copy) :
base(sfShape_Copy(copy.This))
{
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Position of the object on screen /// Position of the object on screen
@ -361,6 +372,25 @@ namespace SFML
return new Shape(sfShape_CreateCircle(center.X, center.Y, radius, color, outline, outlineColor)); return new Shape(sfShape_CreateCircle(center.X, center.Y, radius, color, outline, outlineColor));
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Shape]" +
" Position = " + Position +
" Rotation = " + Rotation +
" Scale = " + Scale +
" Origin = " + Origin +
" Color = " + Color +
" BlendMode = " + BlendMode +
" OutlineWidth = " + OutlineWidth +
" NbPoints = " + NbPoints;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Render the object into the given render window /// Render the object into the given render window
@ -417,6 +447,9 @@ namespace SFML
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfShape_Create(); static extern IntPtr sfShape_Create();
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfShape_Copy(IntPtr Shape);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern void sfShape_Destroy(IntPtr This); static extern void sfShape_Destroy(IntPtr This);

View File

@ -36,6 +36,18 @@ namespace SFML
Image = image; Image = image;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the sprite from another sprite
/// </summary>
/// <param name="copy">Sprite to copy</param>
////////////////////////////////////////////////////////////
public Sprite(Sprite copy) :
base(sfSprite_Copy(copy.This))
{
Image = copy.Image;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Position of the object on screen /// Position of the object on screen
@ -215,6 +227,27 @@ namespace SFML
return sfSprite_GetPixel(This, x, y); return sfSprite_GetPixel(This, x, y);
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Sprite]" +
" Position = " + Position +
" Rotation = " + Rotation +
" Scale = " + Scale +
" Origin = " + Origin +
" Color = " + Color +
" BlendMode = " + BlendMode +
" Width = " + Width +
" Height = " + Height +
" SubRect = " + SubRect +
" Image = " + Image;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Render the object into the given render window /// Render the object into the given render window
@ -262,6 +295,9 @@ namespace SFML
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfSprite_Create(); static extern IntPtr sfSprite_Create();
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfSprite_Copy(IntPtr Sprite);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern void sfSprite_Destroy(IntPtr This); static extern void sfSprite_Destroy(IntPtr This);

View File

@ -83,6 +83,18 @@ namespace SFML
Size = size; Size = size;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the text from another text
/// </summary>
/// <param name="copy">Text to copy</param>
////////////////////////////////////////////////////////////
public Text(Text copy) :
base(sfText_Copy(copy.This))
{
Font = copy.Font;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Position of the object on screen /// Position of the object on screen
@ -256,6 +268,28 @@ namespace SFML
return Pos; return Pos;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Text]" +
" Position = " + Position +
" Rotation = " + Rotation +
" Scale = " + Scale +
" Origin = " + Origin +
" Color = " + Color +
" BlendMode = " + BlendMode +
" String = " + DisplayedString +
" Font = " + Font +
" Size = " + Size +
" Style = " + Style +
" Rectangle = " + GetRect();
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Render the object into the given render window /// Render the object into the given render window
@ -303,6 +337,9 @@ namespace SFML
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfText_Create(); static extern IntPtr sfText_Create();
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfText_Copy(IntPtr Text);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern void sfText_Destroy(IntPtr This); static extern void sfText_Destroy(IntPtr This);

View File

@ -104,6 +104,19 @@ namespace SFML
return new Vector2(v.X / x, v.Y / x); return new Vector2(v.X / x, v.Y / x);
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Vector2]" +
" X = " + X +
" Y = " + Y;
}
/// <summary>X (horizontal) component of the vector</summary> /// <summary>X (horizontal) component of the vector</summary>
public float X; public float X;

View File

@ -49,6 +49,17 @@ namespace SFML
this.Size = size; 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> /// <summary>
/// Center of the view /// Center of the view
@ -138,6 +149,21 @@ namespace SFML
sfView_Zoom(This, factor); 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> /// <summary>
/// Internal constructor for other classes which need to manipulate raw views /// Internal constructor for other classes which need to manipulate raw views
@ -167,6 +193,9 @@ namespace SFML
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfView_CreateFromRect(FloatRect Rect); static extern IntPtr sfView_CreateFromRect(FloatRect Rect);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfView_Copy(IntPtr View);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern void sfView_Destroy(IntPtr View); static extern void sfView_Destroy(IntPtr View);

View File

@ -57,6 +57,22 @@ namespace SFML
MinorVersion = minorVersion; MinorVersion = minorVersion;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[ContextSettings]" +
" DepthBits = " + DepthBits +
" StencilBits = " + StencilBits +
" AntialiasingLevel = " + AntialiasingLevel +
" MajorVersion = " + MajorVersion +
" MinorVersion = " + MinorVersion;
}
/// <summary>Depth buffer bits (0 is disabled)</summary> /// <summary>Depth buffer bits (0 is disabled)</summary>
public uint DepthBits; public uint DepthBits;

View File

@ -25,6 +25,21 @@ namespace SFML
Shift = e.Shift != 0; Shift = e.Shift != 0;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[KeyEventArgs]" +
" Code = " + Code +
" Alt = " + Alt +
" Control = " + Control +
" Shift = " + Shift;
}
/// <summary>Code of the key (see KeyCode enum)</summary> /// <summary>Code of the key (see KeyCode enum)</summary>
public KeyCode Code; public KeyCode Code;
@ -56,6 +71,18 @@ namespace SFML
Unicode = Char.ConvertFromUtf32((int)e.Unicode); Unicode = Char.ConvertFromUtf32((int)e.Unicode);
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[TextEventArgs]" +
" Unicode = " + Unicode;
}
/// <summary>UTF-16 value of the character</summary> /// <summary>UTF-16 value of the character</summary>
public string Unicode; public string Unicode;
} }
@ -79,6 +106,19 @@ namespace SFML
Y = e.Y; Y = e.Y;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[MouseMoveEventArgs]" +
" X = " + X +
" Y = " + Y;
}
/// <summary>X coordinate of the mouse cursor</summary> /// <summary>X coordinate of the mouse cursor</summary>
public int X; public int X;
@ -106,6 +146,20 @@ namespace SFML
Y = e.Y; Y = e.Y;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[MouseButtonEventArgs]" +
" Button = " + Button +
" X = " + X +
" Y = " + Y;
}
/// <summary>Code of the button (see MouseButton enum)</summary> /// <summary>Code of the button (see MouseButton enum)</summary>
public MouseButton Button; public MouseButton Button;
@ -136,6 +190,20 @@ namespace SFML
Y = e.Y; Y = e.Y;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[MouseWheelEventArgs]" +
" Delta = " + Delta +
" X = " + X +
" Y = " + Y;
}
/// <summary>Scroll amount</summary> /// <summary>Scroll amount</summary>
public int Delta; public int Delta;
@ -166,6 +234,20 @@ namespace SFML
Position = e.Position; Position = e.Position;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[JoyMoveEventArgs]" +
" JoystickId = " + JoystickId +
" Axis = " + Axis +
" Position = " + Position;
}
/// <summary>Index of the joystick which triggered the event</summary> /// <summary>Index of the joystick which triggered the event</summary>
public uint JoystickId; public uint JoystickId;
@ -195,6 +277,19 @@ namespace SFML
Button = e.Button; Button = e.Button;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[JoyButtonEventArgs]" +
" JoystickId = " + JoystickId +
" Button = " + Button;
}
/// <summary>Index of the joystick which triggered the event</summary> /// <summary>Index of the joystick which triggered the event</summary>
public uint JoystickId; public uint JoystickId;
@ -221,6 +316,19 @@ namespace SFML
Height = e.Height; Height = e.Height;
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[SizeEventArgs]" +
" Width = " + Width +
" Height = " + Height;
}
/// <summary>New width of the window</summary> /// <summary>New width of the window</summary>
public uint Width; public uint Width;

View File

@ -98,6 +98,17 @@ namespace SFML
{ {
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Input]";
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Handle the destruction of the object /// Handle the destruction of the object

View File

@ -88,6 +88,20 @@ namespace SFML
get {return sfVideoMode_GetDesktopMode();} get {return sfVideoMode_GetDesktopMode();}
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[VideoMode]" +
" Width = " + Width +
" Height = " + Height +
" BitsPerPixel = " + BitsPerPixel;
}
/// <summary>Video mode width, in pixels</summary> /// <summary>Video mode width, in pixels</summary>
public uint Width; public uint Width;

View File

@ -363,6 +363,20 @@ namespace SFML
CallEventHandler(e); CallEventHandler(e);
} }
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Window]" +
" Width = " + Width +
" Height = " + Height +
" Settings = " + Settings;
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// <summary> /// <summary>
/// Constructor for derived classes /// Constructor for derived classes