mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 13:06:13 +01:00
Update to latest SFML 3 API
This commit is contained in:
1 parent
a9c35c8e85
commit
b778f44681
34 files changed
+319
-382
No files matched your search
@@ -110,14 +110,14 @@ CSFML_AUDIO_API void sfMusic_destroy(sfMusic* music);
|
||||
///
|
||||
/// If set, the music will restart from beginning after
|
||||
/// reaching the end and so on, until it is stopped or
|
||||
/// sfMusic_setLoop(music, false) is called.
|
||||
/// sfMusic_setLooping(music, false) is called.
|
||||
/// The default looping state for musics is false.
|
||||
///
|
||||
/// \param music Music object
|
||||
/// \param loop true to play in loop, false to play once
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfMusic_setLoop(sfMusic* music, bool loop);
|
||||
CSFML_AUDIO_API void sfMusic_setLooping(sfMusic* music, bool loop);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether or not a music is in loop mode
|
||||
@@ -127,7 +127,7 @@ CSFML_AUDIO_API void sfMusic_setLoop(sfMusic* music, bool loop);
|
||||
/// \return true if the music is looping, false otherwise
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API bool sfMusic_getLoop(const sfMusic* music);
|
||||
CSFML_AUDIO_API bool sfMusic_isLooping(const sfMusic* music);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the total duration of a music
|
||||
|
||||
@@ -128,14 +128,14 @@ CSFML_AUDIO_API const sfSoundBuffer* sfSound_getBuffer(const sfSound* sound);
|
||||
///
|
||||
/// If set, the sound will restart from beginning after
|
||||
/// reaching the end and so on, until it is stopped or
|
||||
/// sfSound_setLoop(sound, false) is called.
|
||||
/// sfSound_setLooping(sound, false) is called.
|
||||
/// The default looping state for sounds is false.
|
||||
///
|
||||
/// \param sound Sound object
|
||||
/// \param loop true to play in loop, false to play once
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfSound_setLoop(sfSound* sound, bool loop);
|
||||
CSFML_AUDIO_API void sfSound_setLooping(sfSound* sound, bool loop);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether or not a sound is in loop mode
|
||||
@@ -145,7 +145,7 @@ CSFML_AUDIO_API void sfSound_setLoop(sfSound* sound, bool loop);
|
||||
/// \return true if the sound is looping, false otherwise
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API bool sfSound_getLoop(const sfSound* sound);
|
||||
CSFML_AUDIO_API bool sfSound_isLooping(const sfSound* sound);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current status of a sound (stopped, paused, playing)
|
||||
|
||||
@@ -259,14 +259,14 @@ CSFML_AUDIO_API void sfSoundStream_setPlayingOffset(sfSoundStream* soundStream,
|
||||
///
|
||||
/// If set, the stream will restart from beginning after
|
||||
/// reaching the end and so on, until it is stopped or
|
||||
/// sfSoundStream_setLoop(stream, false) is called.
|
||||
/// sfSoundStream_setLooping(stream, false) is called.
|
||||
/// The default looping state for sound streams is false.
|
||||
///
|
||||
/// \param soundStream Sound stream object
|
||||
/// \param loop true to play in loop, false to play once
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfSoundStream_setLoop(sfSoundStream* soundStream, bool loop);
|
||||
CSFML_AUDIO_API void sfSoundStream_setLooping(sfSoundStream* soundStream, bool loop);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the pitch of a sound stream
|
||||
@@ -337,7 +337,7 @@ CSFML_AUDIO_API float sfSoundStream_getAttenuation(const sfSoundStream* soundStr
|
||||
/// \return true if the music is looping, false otherwise
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API bool sfSoundStream_getLoop(const sfSoundStream* soundStream);
|
||||
CSFML_AUDIO_API bool sfSoundStream_isLooping(const sfSoundStream* soundStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current playing position of a sound stream
|
||||
|
||||
@@ -39,18 +39,14 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef struct
|
||||
{
|
||||
float left;
|
||||
float top;
|
||||
float width;
|
||||
float height;
|
||||
sfVector2f position;
|
||||
sfVector2f size;
|
||||
} sfFloatRect;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int width;
|
||||
int height;
|
||||
sfVector2i position;
|
||||
sfVector2i size;
|
||||
} sfIntRect;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -79,27 +75,5 @@ CSFML_GRAPHICS_API bool sfIntRect_contains(const sfIntRect* rect, int x, int y);
|
||||
CSFML_GRAPHICS_API bool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection);
|
||||
CSFML_GRAPHICS_API bool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the position of the rectangle's top-left corner
|
||||
///
|
||||
/// \return Position of rectangle
|
||||
///
|
||||
/// \see getSize
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVector2f sfFloatRect_getPosition(const sfFloatRect* rect);
|
||||
CSFML_GRAPHICS_API sfVector2i sfIntRect_getPosition(const sfIntRect* rect);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the size of the rectangle
|
||||
///
|
||||
/// \return Size of rectangle
|
||||
///
|
||||
/// \see getPosition
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVector2f sfFloatRect_getSize(const sfFloatRect* rect);
|
||||
CSFML_GRAPHICS_API sfVector2i sfIntRect_getSize(const sfIntRect* rect);
|
||||
|
||||
|
||||
#endif // SFML_RECT_H
|
||||
@@ -117,17 +117,6 @@ CSFML_GRAPHICS_API void sfView_setRotation(sfView* view, float angle);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfView_setViewport(sfView* view, sfFloatRect viewport);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Reset a view to the given rectangle
|
||||
///
|
||||
/// Note that this function resets the rotation angle to 0.
|
||||
///
|
||||
/// \param view View object
|
||||
/// \param rectangle Rectangle defining the zone to display
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfView_reset(sfView* view, sfFloatRect rectangle);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the center of a view
|
||||
///
|
||||
|
||||
@@ -29,10 +29,11 @@
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/System/Export.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
typedef int64_t (*sfInputStreamReadFunc)(void* data, int64_t size, void* userData);
|
||||
typedef int64_t (*sfInputStreamSeekFunc)(int64_t position, void* userData);
|
||||
typedef int64_t (*sfInputStreamReadFunc)(void* data, size_t size, void* userData);
|
||||
typedef int64_t (*sfInputStreamSeekFunc)(size_t position, void* userData);
|
||||
typedef int64_t (*sfInputStreamTellFunc)(void* userData);
|
||||
typedef int64_t (*sfInputStreamGetSizeFunc)(void* userData);
|
||||
|
||||
|
||||
Reference in new issue
Block a user