mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -215,6 +215,29 @@ namespace SFML
|
||||
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>
|
||||
/// Handle the destruction of the object
|
||||
|
@ -53,6 +53,18 @@ namespace SFML
|
||||
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>
|
||||
/// Play the sound
|
||||
@ -198,6 +210,27 @@ namespace SFML
|
||||
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>
|
||||
/// Handle the destruction of the object
|
||||
@ -215,6 +248,9 @@ namespace SFML
|
||||
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfSound_Create();
|
||||
|
||||
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfSound_Copy(IntPtr Sound);
|
||||
|
||||
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
|
||||
static extern void sfSound_Destroy(IntPtr Sound);
|
||||
|
||||
|
@ -77,6 +77,17 @@ namespace SFML
|
||||
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>
|
||||
/// 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>
|
||||
/// Handle the destruction of the object
|
||||
@ -155,6 +180,9 @@ namespace SFML
|
||||
[DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity]
|
||||
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]
|
||||
static extern void sfSoundBuffer_Destroy(IntPtr SoundBuffer);
|
||||
|
||||
|
@ -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>
|
||||
/// Called when a new capture starts
|
||||
|
@ -83,6 +83,18 @@ namespace SFML
|
||||
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>
|
||||
/// Called when a new capture starts
|
||||
|
@ -180,6 +180,28 @@ namespace SFML
|
||||
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>
|
||||
/// Set the audio stream parameters, you must call it before Play()
|
||||
|
@ -106,6 +106,20 @@ namespace SFML
|
||||
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>
|
||||
public float X;
|
||||
|
||||
|
@ -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>
|
||||
public byte R;
|
||||
|
||||
|
@ -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 IntPtr myThis = IntPtr.Zero;
|
||||
|
@ -74,6 +74,17 @@ namespace SFML
|
||||
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>
|
||||
/// 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>
|
||||
/// Handle the destruction of the object
|
||||
@ -190,6 +212,9 @@ namespace SFML
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
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]
|
||||
static extern void sfFont_Destroy(IntPtr This);
|
||||
|
||||
|
@ -120,6 +120,17 @@ namespace SFML
|
||||
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>
|
||||
/// Save the contents of the image to a file
|
||||
@ -297,6 +308,20 @@ namespace SFML
|
||||
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>
|
||||
/// Internal constructor
|
||||
@ -338,6 +363,9 @@ namespace SFML
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfImage_CreateFromFile(string Filename);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfImage_Copy(IntPtr Image);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
unsafe static extern IntPtr sfImage_CreateFromMemory(char* Data, uint Size);
|
||||
|
||||
|
@ -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>
|
||||
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>
|
||||
public float Left;
|
||||
|
||||
|
@ -242,6 +242,22 @@ namespace SFML
|
||||
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>
|
||||
/// Handle the destruction of the object
|
||||
|
@ -425,6 +425,22 @@ namespace SFML
|
||||
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>
|
||||
/// Internal function to get the next event
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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>
|
||||
/// 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));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// <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>
|
||||
/// Render the object into the given render window
|
||||
@ -417,6 +447,9 @@ namespace SFML
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfShape_Create();
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfShape_Copy(IntPtr Shape);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern void sfShape_Destroy(IntPtr This);
|
||||
|
||||
|
@ -36,6 +36,18 @@ namespace SFML
|
||||
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>
|
||||
/// Position of the object on screen
|
||||
@ -215,6 +227,27 @@ namespace SFML
|
||||
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>
|
||||
/// Render the object into the given render window
|
||||
@ -262,6 +295,9 @@ namespace SFML
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfSprite_Create();
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfSprite_Copy(IntPtr Sprite);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern void sfSprite_Destroy(IntPtr This);
|
||||
|
||||
|
@ -83,6 +83,18 @@ namespace SFML
|
||||
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>
|
||||
/// Position of the object on screen
|
||||
@ -256,6 +268,28 @@ namespace SFML
|
||||
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>
|
||||
/// Render the object into the given render window
|
||||
@ -303,6 +337,9 @@ namespace SFML
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfText_Create();
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern IntPtr sfText_Copy(IntPtr Text);
|
||||
|
||||
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
|
||||
static extern void sfText_Destroy(IntPtr This);
|
||||
|
||||
|
@ -104,6 +104,19 @@ namespace SFML
|
||||
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>
|
||||
public float X;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -57,6 +57,22 @@ namespace SFML
|
||||
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>
|
||||
public uint DepthBits;
|
||||
|
||||
|
@ -25,6 +25,21 @@ namespace SFML
|
||||
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>
|
||||
public KeyCode Code;
|
||||
|
||||
@ -56,6 +71,18 @@ namespace SFML
|
||||
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>
|
||||
public string Unicode;
|
||||
}
|
||||
@ -79,6 +106,19 @@ namespace SFML
|
||||
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>
|
||||
public int X;
|
||||
|
||||
@ -106,6 +146,20 @@ namespace SFML
|
||||
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>
|
||||
public MouseButton Button;
|
||||
|
||||
@ -136,6 +190,20 @@ namespace SFML
|
||||
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>
|
||||
public int Delta;
|
||||
|
||||
@ -166,6 +234,20 @@ namespace SFML
|
||||
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>
|
||||
public uint JoystickId;
|
||||
|
||||
@ -195,6 +277,19 @@ namespace SFML
|
||||
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>
|
||||
public uint JoystickId;
|
||||
|
||||
@ -221,6 +316,19 @@ namespace SFML
|
||||
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>
|
||||
public uint Width;
|
||||
|
||||
|
@ -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>
|
||||
/// Handle the destruction of the object
|
||||
|
@ -88,6 +88,20 @@ namespace SFML
|
||||
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>
|
||||
public uint Width;
|
||||
|
||||
|
@ -363,6 +363,20 @@ namespace SFML
|
||||
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>
|
||||
/// Constructor for derived classes
|
||||
|
Loading…
Reference in New Issue
Block a user