FS#144 - Implement copy "constructors" in CSFML

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1320 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-01-05 17:52:56 +00:00
parent da44e3d8e5
commit bc6beac402
38 changed files with 379 additions and 48 deletions

View File

@ -41,6 +41,16 @@
////////////////////////////////////////////////////////////
CSFML_API sfSound* sfSound_Create();
////////////////////////////////////////////////////////////
/// Copy an existing sound
///
/// \param sound : Sound to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfSound* sfSound_Copy(sfSound* sound);
////////////////////////////////////////////////////////////
/// Destroy an existing sound
///

View File

@ -68,6 +68,16 @@ CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const char* data, size_t
////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t samplesCount, unsigned int channelsCount, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// Copy an existing sound buffer
///
/// \param soundBuffer : Sound buffer to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// Destroy an existing sound buffer
///

View File

@ -53,6 +53,16 @@ CSFML_API sfFont* sfFont_CreateFromFile(const char* filename);
////////////////////////////////////////////////////////////
CSFML_API sfFont* sfFont_CreateFromMemory(const char* data, size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// Copy an existing font
///
/// \param font : Font to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfFont* sfFont_Copy(sfFont* font);
////////////////////////////////////////////////////////////
/// Destroy an existing font
///

View File

@ -87,6 +87,16 @@ CSFML_API sfImage* sfImage_CreateFromFile(const char* filename);
////////////////////////////////////////////////////////////
CSFML_API sfImage* sfImage_CreateFromMemory(const char* data, size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// Copy an existing image
///
/// \param image : Image to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfImage* sfImage_Copy(sfImage* image);
////////////////////////////////////////////////////////////
/// Destroy an existing image
///
@ -128,7 +138,7 @@ CSFML_API void sfImage_CreateMaskFromColor(sfImage* image, sfColor colorKey, sfU
/// \param sourceRect : Sub-rectangle of the source image to copy
///
////////////////////////////////////////////////////////////
CSFML_API void sfImage_Copy(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect);
CSFML_API void sfImage_CopyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect);
////////////////////////////////////////////////////////////
/// Create the image from the current contents of the

View File

@ -52,6 +52,16 @@ CSFML_API sfShader* sfShader_CreateFromFile(const char* filename);
////////////////////////////////////////////////////////////
CSFML_API sfShader* sfShader_CreateFromMemory(const char* effect);
////////////////////////////////////////////////////////////
/// Copy an existing shader
///
/// \param shader : Shader to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfShader* sfShader_Copy(sfShader* shader);
////////////////////////////////////////////////////////////
/// Destroy an existing shader
///

View File

@ -79,6 +79,16 @@ CSFML_API sfShape* sfShape_CreateRectangle(float p1x, float p1y, float p2x, floa
////////////////////////////////////////////////////////////
CSFML_API sfShape* sfShape_CreateCircle(float x, float y, float radius, sfColor color, float outline, sfColor outlineColor);
////////////////////////////////////////////////////////////
/// Copy an existing shape
///
/// \param shape : Shape to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfShape* sfShape_Copy(sfShape* shape);
////////////////////////////////////////////////////////////
/// Destroy an existing Shape
///

View File

@ -43,6 +43,16 @@
////////////////////////////////////////////////////////////
CSFML_API sfSprite* sfSprite_Create();
////////////////////////////////////////////////////////////
/// Copy an existing sprite
///
/// \param sprite : Sprite to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfSprite* sfSprite_Copy(sfSprite* sprite);
////////////////////////////////////////////////////////////
/// Destroy an existing sprite
///

View File

@ -55,6 +55,16 @@ typedef enum
////////////////////////////////////////////////////////////
CSFML_API sfText* sfText_Create();
////////////////////////////////////////////////////////////
/// Copy an existing text
///
/// \param text : Text to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfText* sfText_Copy(sfText* text);
////////////////////////////////////////////////////////////
/// Destroy an existing text
///

View File

@ -47,6 +47,16 @@ CSFML_API sfView* sfView_Create();
////////////////////////////////////////////////////////////
CSFML_API sfView* sfView_CreateFromRect(sfFloatRect rectangle);
////////////////////////////////////////////////////////////
/// Copy an existing view
///
/// \param view : View to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfView* sfView_Copy(sfView* view);
////////////////////////////////////////////////////////////
/// Destroy an existing view
///

View File

@ -40,6 +40,16 @@
////////////////////////////////////////////////////////////
CSFML_API sfPacket* sfPacket_Create();
////////////////////////////////////////////////////////////
/// Copy an existing packet
///
/// \param packet : Packet to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfPacket* sfPacket_Copy(sfPacket* packet);
////////////////////////////////////////////////////////////
/// Destroy an existing packet
///

View File

@ -41,6 +41,17 @@
CSFML_API sfSelectorTCP* sfSelectorTCP_Create();
CSFML_API sfSelectorUDP* sfSelectorUDP_Create();
////////////////////////////////////////////////////////////
/// Copy an existing selector
///
/// \param selector : Selector to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfSelectorTCP* sfSelectorTCP_Copy(sfSelectorTCP* selector);
CSFML_API sfSelectorUDP* sfSelectorUDP_Copy(sfSelectorUDP* selector);
////////////////////////////////////////////////////////////
/// Destroy an existing selector
///

View File

@ -42,6 +42,16 @@
////////////////////////////////////////////////////////////
CSFML_API sfSocketTCP* sfSocketTCP_Create();
////////////////////////////////////////////////////////////
/// Copy an existing TCP socket
///
/// \param socket : Socket to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketTCP* sfSocketTCP_Copy(sfSocketTCP* socket);
////////////////////////////////////////////////////////////
/// Destroy an existing TCP socket
///

View File

@ -42,6 +42,16 @@
////////////////////////////////////////////////////////////
CSFML_API sfSocketUDP* sfSocketUDP_Create();
////////////////////////////////////////////////////////////
/// Copy an existing UDP socket
///
/// \param socket : Socket to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketUDP* sfSocketUDP_Copy(sfSocketUDP* socket);
////////////////////////////////////////////////////////////
/// Destroy an existing UDP socket
///

View File

@ -40,6 +40,16 @@
////////////////////////////////////////////////////////////
CSFML_API sfClock* sfClock_Create();
////////////////////////////////////////////////////////////
/// Copy an existing clock
///
/// \param clock : Clock to copy
///
/// \return Copied object
///
////////////////////////////////////////////////////////////
CSFML_API sfClock* sfClock_Copy(sfClock* clock);
////////////////////////////////////////////////////////////
/// Destroy an existing clock
///

View File

@ -39,6 +39,17 @@ sfSound* sfSound_Create()
}
////////////////////////////////////////////////////////////
/// Copy an existing sound
////////////////////////////////////////////////////////////
sfSound* sfSound_Copy(sfSound* sound)
{
CSFML_CHECK_RETURN(sound, NULL);
return new sfSound(*sound);
}
////////////////////////////////////////////////////////////
/// Destroy an existing sound
////////////////////////////////////////////////////////////

View File

@ -83,6 +83,17 @@ sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t sa
}
////////////////////////////////////////////////////////////
/// Copy an existing sound buffer
////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer)
{
CSFML_CHECK_RETURN(soundBuffer, NULL);
return new sfSoundBuffer(*soundBuffer);
}
////////////////////////////////////////////////////////////
/// Destroy an existing sound buffer
////////////////////////////////////////////////////////////

View File

@ -33,6 +33,7 @@ EXPORTS
sfMusic_GetAttenuation
sfMusic_GetPlayingOffset
sfSound_Create
sfSound_Copy
sfSound_Destroy
sfSound_Play
sfSound_Pause
@ -59,6 +60,7 @@ EXPORTS
sfSoundBuffer_CreateFromFile
sfSoundBuffer_CreateFromMemory
sfSoundBuffer_CreateFromSamples
sfSoundBuffer_Copy
sfSoundBuffer_Destroy
sfSoundBuffer_SaveToFile
sfSoundBuffer_GetSamples

View File

@ -33,6 +33,7 @@ EXPORTS
sfMusic_GetAttenuation
sfMusic_GetPlayingOffset
sfSound_Create
sfSound_Copy
sfSound_Destroy
sfSound_Play
sfSound_Pause
@ -59,6 +60,7 @@ EXPORTS
sfSoundBuffer_CreateFromFile
sfSoundBuffer_CreateFromMemory
sfSoundBuffer_CreateFromSamples
sfSoundBuffer_Copy
sfSoundBuffer_Destroy
sfSoundBuffer_SaveToFile
sfSoundBuffer_GetSamples

View File

@ -62,6 +62,17 @@ sfFont* sfFont_CreateFromMemory(const char* data, size_t sizeInBytes)
}
////////////////////////////////////////////////////////////
/// Copy an existing font
////////////////////////////////////////////////////////////
sfFont* sfFont_Copy(sfFont* font)
{
CSFML_CHECK_RETURN(font, NULL);
return new sfFont(*font);
}
////////////////////////////////////////////////////////////
/// Destroy an existing font
////////////////////////////////////////////////////////////
@ -79,7 +90,7 @@ sfGlyph sfFont_GetGlyph(sfFont* font, sfUint32 codePoint, unsigned int character
sfGlyph glyph = {0, {0, 0, 0, 0}, {0, 0, 0, 0}};
CSFML_CHECK_RETURN(font, glyph);
sf::Glyph SFMLGlyph = font->This.GetGlyph(codePoint, characterSize, bold);
sf::Glyph SFMLGlyph = font->This.GetGlyph(codePoint, characterSize, bold == sfTrue);
glyph.Advance = SFMLGlyph.Advance;
glyph.Rectangle.Left = SFMLGlyph.Rectangle.Left;

View File

@ -108,6 +108,17 @@ sfImage* sfImage_CreateFromMemory(const char* data, size_t sizeInBytes)
}
////////////////////////////////////////////////////////////
/// Copy an existing image
////////////////////////////////////////////////////////////
sfImage* sfImage_Copy(sfImage* image)
{
CSFML_CHECK_RETURN(image, NULL);
return new sfImage(*image);
}
////////////////////////////////////////////////////////////
/// Destroy an existing image
////////////////////////////////////////////////////////////
@ -141,7 +152,7 @@ void sfImage_CreateMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha
/// This function does a slow pixel copy and should only
/// be used at initialization time
////////////////////////////////////////////////////////////
void sfImage_Copy(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect)
void sfImage_CopyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect)
{
CSFML_CHECK(source);
sf::IntRect SFMLRect(sourceRect.Left, sourceRect.Top, sourceRect.Right, sourceRect.Bottom);

View File

@ -48,6 +48,12 @@ struct sfImage
OwnInstance = false;
}
sfImage(const sfImage& image)
{
This = image.This ? new sf::Image(*image.This) : NULL;
OwnInstance = true;
}
~sfImage()
{
if (OwnInstance)

View File

@ -65,6 +65,17 @@ sfShader* sfShader_CreateFromMemory(const char* effect)
}
////////////////////////////////////////////////////////////
/// Copy an existing clock
////////////////////////////////////////////////////////////
sfShader* sfShader_Copy(sfShader* shader)
{
CSFML_CHECK_RETURN(shader, NULL);
return new sfShader(*shader);
}
////////////////////////////////////////////////////////////
/// Destroy an existing shader
////////////////////////////////////////////////////////////

View File

@ -82,6 +82,17 @@ sfShape* sfShape_CreateCircle(float x, float y, float radius, sfColor color, flo
}
////////////////////////////////////////////////////////////
/// Copy an existing shape
////////////////////////////////////////////////////////////
sfShape* sfShape_Copy(sfShape* shape)
{
CSFML_CHECK_RETURN(shape, NULL);
return new sfShape(*shape);
}
////////////////////////////////////////////////////////////
/// Destroy an existing shape
////////////////////////////////////////////////////////////

View File

@ -48,6 +48,17 @@ sfSprite* sfSprite_Create()
}
////////////////////////////////////////////////////////////
/// Copy an existing sprite
////////////////////////////////////////////////////////////
sfSprite* sfSprite_Copy(sfSprite* sprite)
{
CSFML_CHECK_RETURN(sprite, NULL);
return new sfSprite(*sprite);
}
////////////////////////////////////////////////////////////
/// Destroy an existing sprite
////////////////////////////////////////////////////////////

View File

@ -44,6 +44,17 @@ sfText* sfText_Create()
}
////////////////////////////////////////////////////////////
/// Copy an existing text
////////////////////////////////////////////////////////////
sfText* sfText_Copy(sfText* text)
{
CSFML_CHECK_RETURN(text, NULL);
return new sfText(*text);
}
////////////////////////////////////////////////////////////
/// Destroy an existing text
////////////////////////////////////////////////////////////

View File

@ -42,54 +42,65 @@ sfView* sfView_Create()
////////////////////////////////////////////////////////////
/// Construct a view from a rectangle
////////////////////////////////////////////////////////////
sfView* sfView_CreateFromRect(sfFloatRect Rect)
sfView* sfView_CreateFromRect(sfFloatRect rectangle)
{
return new sfView(Rect);
return new sfView(rectangle);
}
////////////////////////////////////////////////////////////
/// Copy an existing view
////////////////////////////////////////////////////////////
sfView* sfView_Copy(sfView* view)
{
CSFML_CHECK_RETURN(view, NULL);
return new sfView(*view);
}
////////////////////////////////////////////////////////////
/// Destroy an existing view
////////////////////////////////////////////////////////////
void sfView_Destroy(sfView* View)
void sfView_Destroy(sfView* view)
{
delete View;
delete view;
}
////////////////////////////////////////////////////////////
/// Change the center of a view
////////////////////////////////////////////////////////////
void sfView_SetCenter(sfView* View, float X, float Y)
void sfView_SetCenter(sfView* view, float x, float y)
{
CSFML_CALL_PTR(View, SetCenter(X, Y));
CSFML_CALL_PTR(view, SetCenter(x, y));
}
////////////////////////////////////////////////////////////
/// Change the size of a view
////////////////////////////////////////////////////////////
void sfView_SetSize(sfView* View, float Width, float Height)
void sfView_SetSize(sfView* view, float width, float height)
{
CSFML_CALL_PTR(View, SetSize(Width, Height));
CSFML_CALL_PTR(view, SetSize(width, height));
}
////////////////////////////////////////////////////////////
/// Set the angle of rotation of a view
////////////////////////////////////////////////////////////
void sfView_SetRotation(sfView* View, float Angle)
void sfView_SetRotation(sfView* view, float angle)
{
CSFML_CALL_PTR(View, SetRotation(Angle));
CSFML_CALL_PTR(view, SetRotation(angle));
}
////////////////////////////////////////////////////////////
/// Set the target viewport of a view
////////////////////////////////////////////////////////////
void sfView_SetViewport(sfView* View, sfFloatRect Viewport)
void sfView_SetViewport(sfView* view, sfFloatRect viewport)
{
CSFML_CALL_PTR(View, SetViewport(sf::FloatRect(Viewport.Left, Viewport.Top, Viewport.Right, Viewport.Bottom)));
CSFML_CALL_PTR(view, SetViewport(sf::FloatRect(viewport.Left, viewport.Top, viewport.Right, viewport.Bottom)));
}
@ -97,105 +108,105 @@ void sfView_SetViewport(sfView* View, sfFloatRect Viewport)
/// Reset a view to the given rectangle.
/// Note: this function resets the rotation angle to 0.
////////////////////////////////////////////////////////////
void sfView_Reset(sfView* View, sfFloatRect Rectangle)
void sfView_Reset(sfView* view, sfFloatRect rectangle)
{
CSFML_CALL_PTR(View, Reset(sf::FloatRect(Rectangle.Left, Rectangle.Top, Rectangle.Right, Rectangle.Bottom)));
CSFML_CALL_PTR(view, Reset(sf::FloatRect(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom)));
}
////////////////////////////////////////////////////////////
/// Get the X coordinate of the center of a view
////////////////////////////////////////////////////////////
float sfView_GetCenterX(const sfView* View)
float sfView_GetCenterX(const sfView* view)
{
CSFML_CHECK_RETURN(View, 0.f);
CSFML_CHECK_RETURN(view, 0.f);
return View->This->GetCenter().x;
return view->This->GetCenter().x;
}
////////////////////////////////////////////////////////////
/// Get the Y coordinate of the center of a view
////////////////////////////////////////////////////////////
float sfView_GetCenterY(const sfView* View)
float sfView_GetCenterY(const sfView* view)
{
CSFML_CHECK_RETURN(View, 0.f);
CSFML_CHECK_RETURN(view, 0.f);
return View->This->GetCenter().y;
return view->This->GetCenter().y;
}
////////////////////////////////////////////////////////////
/// Get the width of the view
////////////////////////////////////////////////////////////
float sfView_GetWidth(const sfView* View)
float sfView_GetWidth(const sfView* view)
{
CSFML_CHECK_RETURN(View, 0.f);
CSFML_CHECK_RETURN(view, 0.f);
return View->This->GetSize().x;
return view->This->GetSize().x;
}
////////////////////////////////////////////////////////////
/// Get the height of the view
////////////////////////////////////////////////////////////
float sfView_GetHeight(const sfView* View)
float sfView_GetHeight(const sfView* view)
{
CSFML_CHECK_RETURN(View, 0.f);
CSFML_CHECK_RETURN(view, 0.f);
return View->This->GetSize().y;
return view->This->GetSize().y;
}
////////////////////////////////////////////////////////////
/// Get the current rotation of a view
////////////////////////////////////////////////////////////
float sfView_GetRotation(const sfView* View)
float sfView_GetRotation(const sfView* view)
{
CSFML_CALL_PTR_RETURN(View, GetRotation(), 0.f);
CSFML_CALL_PTR_RETURN(view, GetRotation(), 0.f);
}
////////////////////////////////////////////////////////////
/// Get the target viewport of a view
////////////////////////////////////////////////////////////
sfFloatRect sfView_GetViewport(const sfView* View)
sfFloatRect sfView_GetViewport(const sfView* view)
{
sfFloatRect Rect = {0, 0, 0, 0};
CSFML_CHECK_RETURN(View, Rect);
sfFloatRect rect = {0, 0, 0, 0};
CSFML_CHECK_RETURN(view, rect);
sf::FloatRect SFMLRect = View->This->GetViewport();
Rect.Left = SFMLRect.Left;
Rect.Top = SFMLRect.Top;
Rect.Right = SFMLRect.Right;
Rect.Bottom = SFMLRect.Bottom;
sf::FloatRect SFMLRect = view->This->GetViewport();
rect.Left = SFMLRect.Left;
rect.Top = SFMLRect.Top;
rect.Right = SFMLRect.Right;
rect.Bottom = SFMLRect.Bottom;
return Rect;
return rect;
}
////////////////////////////////////////////////////////////
/// Move a view
////////////////////////////////////////////////////////////
void sfView_Move(sfView* View, float OffsetX, float OffsetY)
void sfView_Move(sfView* view, float offsetX, float offsetY)
{
CSFML_CALL_PTR(View, Move(OffsetX, OffsetY));
CSFML_CALL_PTR(view, Move(offsetX, offsetY));
}
////////////////////////////////////////////////////////////
/// Rotate a view
////////////////////////////////////////////////////////////
void sfView_Rotate(sfView* View, float Angle)
void sfView_Rotate(sfView* view, float angle)
{
CSFML_CALL_PTR(View, Rotate(Angle));
CSFML_CALL_PTR(view, Rotate(angle));
}
////////////////////////////////////////////////////////////
/// Resize a view rectangle to simulate a zoom / unzoom effect
////////////////////////////////////////////////////////////
void sfView_Zoom(sfView* View, float Factor)
void sfView_Zoom(sfView* view, float factor)
{
CSFML_CALL_PTR(View, Zoom(Factor));
CSFML_CALL_PTR(view, Zoom(factor));
}

View File

@ -54,6 +54,12 @@ struct sfView
{
}
sfView(const sfView& View) :
This(View.This ? new sf::View(*View.This) : NULL),
OwnInstance(true)
{
}
~sfView()
{
if (OwnInstance)

View File

@ -17,10 +17,11 @@ EXPORTS
sfImage_CreateFromPixels
sfImage_CreateFromFile
sfImage_CreateFromMemory
sfImage_Copy
sfImage_Destroy
sfImage_SaveToFile
sfImage_CreateMaskFromColor
sfImage_Copy
sfImage_CopyImage
sfImage_CopyScreen
sfImage_SetPixel
sfImage_GetPixel
@ -38,6 +39,7 @@ EXPORTS
sfIntRect_Intersects
sfShader_CreateFromFile
sfShader_CreateFromMemory
sfShader_Copy
sfShader_Destroy
sfShader_SetParameter1
sfShader_SetParameter2
@ -51,6 +53,7 @@ EXPORTS
sfShape_CreateLine
sfShape_CreateRectangle
sfShape_CreateCircle
sfShape_Copy
sfShape_Destroy
sfShape_SetX
sfShape_SetY
@ -89,6 +92,7 @@ EXPORTS
sfShape_SetPointColor
sfShape_SetPointOutlineColor
sfSprite_Create
sfSprite_Copy
sfSprite_Destroy
sfSprite_SetX
sfSprite_SetY
@ -126,6 +130,7 @@ EXPORTS
sfSprite_GetPixel
sfFont_CreateFromFile
sfFont_CreateFromMemory
sfFont_Copy
sfFont_Destroy
sfFont_GetGlyph
sfFont_GetKerning
@ -133,6 +138,7 @@ EXPORTS
sfFont_GetImage
sfFont_GetDefaultFont
sfText_Create
sfText_Copy
sfText_Destroy
sfText_SetX
sfText_SetY
@ -227,6 +233,7 @@ EXPORTS
sfRenderWindow_ConvertCoords
sfView_Create
sfView_CreateFromRect
sfView_Copy
sfView_Destroy
sfView_SetCenter
sfView_SetSize

View File

@ -17,10 +17,11 @@ EXPORTS
sfImage_CreateFromPixels
sfImage_CreateFromFile
sfImage_CreateFromMemory
sfImage_Copy
sfImage_Destroy
sfImage_SaveToFile
sfImage_CreateMaskFromColor
sfImage_Copy
sfImage_CopyImage
sfImage_CopyScreen
sfImage_SetPixel
sfImage_GetPixel
@ -38,6 +39,7 @@ EXPORTS
sfIntRect_Intersects
sfShader_CreateFromFile
sfShader_CreateFromMemory
sfShader_Copy
sfShader_Destroy
sfShader_SetParameter1
sfShader_SetParameter2
@ -51,6 +53,7 @@ EXPORTS
sfShape_CreateLine
sfShape_CreateRectangle
sfShape_CreateCircle
sfShape_Copy
sfShape_Destroy
sfShape_SetX
sfShape_SetY
@ -89,6 +92,7 @@ EXPORTS
sfShape_SetPointColor
sfShape_SetPointOutlineColor
sfSprite_Create
sfSprite_Copy
sfSprite_Destroy
sfSprite_SetX
sfSprite_SetY
@ -126,6 +130,7 @@ EXPORTS
sfSprite_GetPixel
sfFont_CreateFromFile
sfFont_CreateFromMemory
sfFont_Copy
sfFont_Destroy
sfFont_GetGlyph
sfFont_GetKerning
@ -133,6 +138,7 @@ EXPORTS
sfFont_GetImage
sfFont_GetDefaultFont
sfText_Create
sfText_Copy
sfText_Destroy
sfText_SetX
sfText_SetY
@ -230,6 +236,7 @@ EXPORTS
sfRenderWindow_ConvertCoords
sfView_Create
sfView_CreateFromRect
sfView_Copy
sfView_Destroy
sfView_SetCenter
sfView_SetSize

View File

@ -67,6 +67,17 @@ sfPacket* sfPacket_Create()
}
////////////////////////////////////////////////////////////
/// Copy an existing packet
////////////////////////////////////////////////////////////
sfPacket* sfPacket_Copy(sfPacket* packet)
{
CSFML_CHECK_RETURN(packet, NULL);
return new sfPacket(*packet);
}
////////////////////////////////////////////////////////////
/// Destroy an existing packet
////////////////////////////////////////////////////////////

View File

@ -37,6 +37,13 @@ sfSelectorTCP* sfSelectorTCP_Create() {return new sfSelectorTCP;}
sfSelectorUDP* sfSelectorUDP_Create() {return new sfSelectorUDP;}
////////////////////////////////////////////////////////////
/// Copy an existing selector
////////////////////////////////////////////////////////////
sfSelectorTCP* sfSelectorTCP_Copy(sfSelectorTCP* selector) {CSFML_CHECK_RETURN(selector, NULL); return new sfSelectorTCP(*selector);}
sfSelectorUDP* sfSelectorUDP_Copy(sfSelectorUDP* selector) {CSFML_CHECK_RETURN(selector, NULL); return new sfSelectorUDP(*selector);}
////////////////////////////////////////////////////////////
/// Destroy an existing selector
////////////////////////////////////////////////////////////

View File

@ -42,6 +42,17 @@ sfSocketTCP* sfSocketTCP_Create()
}
////////////////////////////////////////////////////////////
/// Copy an existing TCP socket
////////////////////////////////////////////////////////////
sfSocketTCP* sfSocketTCP_Copy(sfSocketTCP* socket)
{
CSFML_CHECK_RETURN(socket, NULL);
return new sfSocketTCP(*socket);
}
////////////////////////////////////////////////////////////
/// Destroy an existing TCP socket
////////////////////////////////////////////////////////////

View File

@ -42,6 +42,17 @@ sfSocketUDP* sfSocketUDP_Create()
}
////////////////////////////////////////////////////////////
/// Copy an existing UDP socket
////////////////////////////////////////////////////////////
sfSocketUDP* sfSocketUDP_Copy(sfSocketUDP* socket)
{
CSFML_CHECK_RETURN(socket, NULL);
return new sfSocketUDP(*socket);
}
////////////////////////////////////////////////////////////
/// Destroy an existing UDP socket
////////////////////////////////////////////////////////////

View File

@ -82,6 +82,7 @@ EXPORTS
sfSocketUDP_Close
sfSocketUDP_IsValid
sfPacket_Create
sfPacket_Copy
sfPacket_Destroy
sfPacket_Append
sfPacket_Clear
@ -112,6 +113,7 @@ EXPORTS
sfPacket_WriteString
sfPacket_WriteWideString
sfSelectorTCP_Create
sfSelectorTCP_Copy
sfSelectorTCP_Destroy
sfSelectorTCP_Add
sfSelectorTCP_Remove
@ -119,6 +121,7 @@ EXPORTS
sfSelectorTCP_Wait
sfSelectorTCP_GetSocketReady
sfSelectorUDP_Create
sfSelectorUDP_Copy
sfSelectorUDP_Destroy
sfSelectorUDP_Add
sfSelectorUDP_Remove

View File

@ -59,6 +59,7 @@ EXPORTS
sfIPAddress_GetPublicAddress
sfIPAddress_LocalHost
sfSocketTCP_Create
sfSocketTCP_Copy
sfSocketTCP_Destroy
sfSocketTCP_SetBlocking
sfSocketTCP_Connect
@ -71,6 +72,7 @@ EXPORTS
sfSocketTCP_Close
sfSocketTCP_IsValid
sfSocketUDP_Create
sfSocketUDP_Copy
sfSocketUDP_Destroy
sfSocketUDP_SetBlocking
sfSocketUDP_Bind
@ -82,6 +84,7 @@ EXPORTS
sfSocketUDP_Close
sfSocketUDP_IsValid
sfPacket_Create
sfPacket_Copy
sfPacket_Destroy
sfPacket_Append
sfPacket_Clear
@ -112,6 +115,7 @@ EXPORTS
sfPacket_WriteString
sfPacket_WriteWideString
sfSelectorTCP_Create
sfSelectorTCP_Copy
sfSelectorTCP_Destroy
sfSelectorTCP_Add
sfSelectorTCP_Remove
@ -119,6 +123,7 @@ EXPORTS
sfSelectorTCP_Wait
sfSelectorTCP_GetSocketReady
sfSelectorUDP_Create
sfSelectorUDP_Copy
sfSelectorUDP_Destroy
sfSelectorUDP_Add
sfSelectorUDP_Remove

View File

@ -39,6 +39,17 @@ sfClock* sfClock_Create()
}
////////////////////////////////////////////////////////////
/// Copy an existing clock
////////////////////////////////////////////////////////////
sfClock* sfClock_Copy(sfClock* clock)
{
CSFML_CHECK_RETURN(clock, NULL);
return new sfClock(*clock);
}
////////////////////////////////////////////////////////////
/// Destroy an existing clock
////////////////////////////////////////////////////////////

View File

@ -1,6 +1,7 @@
LIBRARY csfml-system-d
EXPORTS
sfClock_Create
sfClock_Copy
sfClock_Destroy
sfClock_GetTime
sfClock_Reset

View File

@ -1,6 +1,7 @@
LIBRARY csfml-system
EXPORTS
sfClock_Create
sfClock_Copy
sfClock_Destroy
sfClock_GetTime
sfClock_Reset