Times in SFML are now Uint32 milliseconds instead of float seconds

Added the sf::Uint64 and sf::Int64 types
This commit is contained in:
Laurent Gomila 2011-05-19 08:18:40 +02:00
parent c1ce16f4d6
commit e4c6c30e0b
83 changed files with 250 additions and 262 deletions

View file

@ -86,10 +86,10 @@ CSFML_API sfBool sfMusic_GetLoop(const sfMusic* music);
///
/// \param music : Music to get the duration from
///
/// \return Music duration, in seconds
/// \return Music duration, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetDuration(const sfMusic* music);
CSFML_API sfUint32 sfMusic_GetDuration(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Start playing a music
@ -150,10 +150,10 @@ CSFML_API sfSoundStatus sfMusic_GetStatus(const sfMusic* music);
///
/// \param music : Music to get the position from
///
/// \return Current playing position, expressed in seconds
/// \return Current playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetPlayingOffset(const sfMusic* music);
CSFML_API sfUint32 sfMusic_GetPlayingOffset(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Set the pitch of a music
@ -221,10 +221,10 @@ CSFML_API void sfMusic_SetAttenuation(sfMusic* music, float attenuation);
/// Set the current playing position of a music
///
/// \param music : Music to modify
/// \param timeOffset : New playing position, expressed in seconds
/// \param timeOffset : New playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetPlayingOffset(sfMusic* music, float timeOffset);
CSFML_API void sfMusic_SetPlayingOffset(sfMusic* music, sfUint32 timeOffset);
////////////////////////////////////////////////////////////
/// Get the pitch of a music

View file

@ -197,10 +197,10 @@ CSFML_API void sfSound_SetAttenuation(sfSound* sound, float attenuation);
/// Set the current playing position of a sound
///
/// \param sound : Sound to modify
/// \param timeOffset : New playing position, expressed in seconds
/// \param timeOffset : New playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetPlayingOffset(sfSound* sound, float timeOffset);
CSFML_API void sfSound_SetPlayingOffset(sfSound* sound, sfUint32 timeOffset);
////////////////////////////////////////////////////////////
/// Get the pitch of a sound
@ -269,10 +269,10 @@ CSFML_API float sfSound_GetAttenuation(const sfSound* sound);
///
/// \param sound : Sound to get the position from
///
/// \return Current playing position, expressed in seconds
/// \return Current playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetPlayingOffset(const sfSound* sound);
CSFML_API sfUint32 sfSound_GetPlayingOffset(const sfSound* sound);
#endif // SFML_SOUND_H

View file

@ -142,10 +142,10 @@ CSFML_API unsigned int sfSoundBuffer_GetChannelsCount(const sfSoundBuffer* sound
///
/// \param soundBuffer : Sound buffer to get duration from
///
/// \return Sound duration, in seconds
/// \return Sound duration, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API float sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer);
CSFML_API sfUint32 sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer);
#endif // SFML_SOUNDBUFFER_H

View file

@ -44,7 +44,7 @@ typedef struct
} sfSoundStreamChunk;
typedef sfBool (*sfSoundStreamGetDataCallback)(sfSoundStreamChunk*, void*); ///< Type of the callback used to get a sound stream data
typedef void (*sfSoundStreamSeekCallback)(float, void*); ///< Type of the callback used to seek in a sound stream
typedef void (*sfSoundStreamSeekCallback)(sfUint32, void*); ///< Type of the callback used to seek in a sound stream
////////////////////////////////////////////////////////////
@ -194,10 +194,10 @@ CSFML_API void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, float at
/// Set the current playing position of a stream
///
/// \param soundStream : Sound stream to modify
/// \param timeOffset : New playing position, expressed in seconds
/// \param timeOffset : New playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, float timeOffset);
CSFML_API void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, sfUint32 timeOffset);
////////////////////////////////////////////////////////////
/// Set a stream loop state
@ -285,10 +285,10 @@ CSFML_API sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream);
///
/// \param soundStream : Sound stream to get the position from
///
/// \return Current playing position, expressed in seconds
/// \return Current playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream);
CSFML_API sfUint32 sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream);
#endif // SFML_SOUNDSTREAM_H

View file

@ -281,10 +281,10 @@ CSFML_API void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, un
///
/// \param renderWindow : Renderwindow object
///
/// \return Time elapsed, in seconds
/// \return Time elapsed, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API float sfRenderWindow_GetFrameTime(const sfRenderWindow* renderWindow);
CSFML_API sfUint32 sfRenderWindow_GetFrameTime(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// Change the joystick threshold, ie. the value below which

View file

@ -282,12 +282,12 @@ CSFML_API void sfFtp_Destroy(sfFtp* ftp);
/// \param ftp : Ftp instance
/// \param server : FTP server to connect to
/// \param port : Port used for connection (21 by default, standard FTP port)
/// \param timeout : Maximum time to wait (0 to use no timeout)
/// \param timeout : Maximum time to wait, in milliseconds (0 to use no timeout)
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, unsigned short port, float timeout);
CSFML_API sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfUint32 timeout);
////////////////////////////////////////////////////////////
/// Log in using anonymous account

View file

@ -246,12 +246,12 @@ CSFML_API void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short por
///
/// \param http : Http object
/// \param request : Request to send
/// \param timeout : Maximum time to wait (0 to use no timeout)
/// \param timeout : Maximum time to wait, in milliseconds (0 to use no timeout)
///
/// \return Server's response, or NULL if request is invalid
///
////////////////////////////////////////////////////////////
CSFML_API sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, float timeout);
CSFML_API sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, sfUint32 timeout);
#endif // SFML_HTTP_H

View file

@ -104,12 +104,12 @@ CSFML_API sfIpAddress sfIpAddress_GetLocalAddress(void);
/// distant website ; as a consequence, this function may be
/// very slow -- use it as few as possible !
///
/// \param timeout : Maximum time to wait, in seconds (use 0 for no timeout)
/// \param timeout : Maximum time to wait, in milliseconds (use 0 for no timeout)
///
/// \return Public IP address
///
////////////////////////////////////////////////////////////
CSFML_API sfIpAddress sfIpAddress_GetPublicAddress(float timeout);
CSFML_API sfIpAddress sfIpAddress_GetPublicAddress(sfUint32 timeout);
////////////////////////////////////////////////////////////
/// Get the computer's loopback address

View file

@ -94,12 +94,12 @@ CSFML_API void sfSocketSelector_Clear(sfSocketSelector* selector);
/// is ready, or when the given timeout is over
///
/// \param selector : Selector to check
/// \param timeout : Maximum time to wait, in seconds (0 to disable timeout)
/// \param timeout : Maximum time to wait, in milliseconds (0 to disable timeout)
///
/// \return sfTrue if there are sockets ready, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketSelector_Wait(sfSocketSelector* selector, float timeout);
CSFML_API sfBool sfSocketSelector_Wait(sfSocketSelector* selector, sfUint32 timeout);
////////////////////////////////////////////////////////////
/// Test a socket to know if it is ready to receive data

View file

@ -106,12 +106,12 @@ CSFML_API unsigned short sfTcpSocket_GetRemotePort(const sfTcpSocket* socket);
/// \param socket : Socket to connect
/// \param host : IP Address of the host to connect to
/// \param port : Port to use for transfers (warning : ports < 1024 are reserved)
/// \param timeout : Maximum time to wait (0 to use no timeout)
/// \param timeout : Maximum time to wait, in milliseconds (0 to use no timeout)
///
/// \return sfTrue if operation has been successful
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, float timeout);
CSFML_API sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfUint32 timeout);
////////////////////////////////////////////////////////////
/// Disconnect a connect from its remote peer

View file

@ -63,8 +63,10 @@ CSFML_API void sfClock_Destroy(sfClock* clock);
///
/// \param clock : Clock to get time from
///
/// \return Elapsed time, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API float sfClock_GetTime(const sfClock* clock);
CSFML_API sfUint32 sfClock_GetTime(const sfClock* clock);
////////////////////////////////////////////////////////////
/// Restart a clock

View file

@ -32,12 +32,12 @@
////////////////////////////////////////////////////////////
/// Make the current thread sleep for a given time
/// Make the current thread sleep for a given duration
///
/// \param duration : Time to sleep, in seconds
/// \param duration : Time to sleep, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API void sfSleep(float duration);
CSFML_API void sfSleep(sfUint32 duration);
#endif // SFML_SLEEP_H

View file

@ -290,10 +290,10 @@ CSFML_API void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit);
///
/// \param window : Window object
///
/// \return Time elapsed, in seconds
/// \return Time elapsed, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API float sfWindow_GetFrameTime(const sfWindow* window);
CSFML_API sfUint32 sfWindow_GetFrameTime(const sfWindow* window);
////////////////////////////////////////////////////////////
/// Change the joystick threshold, ie. the value below which

View file

@ -94,9 +94,9 @@ sfBool sfMusic_GetLoop(const sfMusic* music)
////////////////////////////////////////////////////////////
/// Get a music duration
////////////////////////////////////////////////////////////
float sfMusic_GetDuration(const sfMusic* music)
sfUint32 sfMusic_GetDuration(const sfMusic* music)
{
CSFML_CALL_RETURN(music, GetDuration(), 0.f);
CSFML_CALL_RETURN(music, GetDuration(), 0);
}
@ -159,9 +159,9 @@ sfSoundStatus sfMusic_GetStatus(const sfMusic* music)
////////////////////////////////////////////////////////////
/// Get the current playing position of a music
////////////////////////////////////////////////////////////
float sfMusic_GetPlayingOffset(const sfMusic* music)
sfUint32 sfMusic_GetPlayingOffset(const sfMusic* music)
{
CSFML_CALL_RETURN(music, GetPlayingOffset(), 0.f);
CSFML_CALL_RETURN(music, GetPlayingOffset(), 0);
}
@ -228,7 +228,7 @@ void sfMusic_SetAttenuation(sfMusic* music, float attenuation)
////////////////////////////////////////////////////////////
/// Set the current playing position of a stream
////////////////////////////////////////////////////////////
void sfMusic_SetPlayingOffset(sfMusic* music, float timeOffset)
void sfMusic_SetPlayingOffset(sfMusic* music, sfUint32 timeOffset)
{
CSFML_CALL(music, SetPlayingOffset(timeOffset));
}

View file

@ -202,7 +202,7 @@ void sfSound_SetAttenuation(sfSound* sound, float attenuation)
////////////////////////////////////////////////////////////
/// Set the current playing position of a sound
////////////////////////////////////////////////////////////
void sfSound_SetPlayingOffset(sfSound* sound, float timeOffset)
void sfSound_SetPlayingOffset(sfSound* sound, sfUint32 timeOffset)
{
CSFML_CALL(sound, SetPlayingOffset(timeOffset));
}
@ -271,7 +271,7 @@ float sfSound_GetAttenuation(const sfSound* sound)
////////////////////////////////////////////////////////////
/// Get the current playing position of a sound
////////////////////////////////////////////////////////////
float sfSound_GetPlayingOffset(const sfSound* sound)
sfUint32 sfSound_GetPlayingOffset(const sfSound* sound)
{
CSFML_CALL_RETURN(sound, GetPlayingOffset(), 0.f)
CSFML_CALL_RETURN(sound, GetPlayingOffset(), 0)
}

View file

@ -151,7 +151,7 @@ unsigned int sfSoundBuffer_GetChannelsCount(const sfSoundBuffer* soundBuffer)
////////////////////////////////////////////////////////////
/// Get the duration of a sound buffer
////////////////////////////////////////////////////////////
float sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer)
sfUint32 sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer)
{
CSFML_CALL_RETURN(soundBuffer, GetDuration(), 0.f)
CSFML_CALL_RETURN(soundBuffer, GetDuration(), 0)
}

View file

@ -172,7 +172,7 @@ void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, float attenuation)
////////////////////////////////////////////////////////////
/// Set the current playing position of a stream
////////////////////////////////////////////////////////////
void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, float timeOffset)
void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, sfUint32 timeOffset)
{
CSFML_CALL(soundStream, SetPlayingOffset(timeOffset));
}
@ -259,7 +259,7 @@ sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream)
////////////////////////////////////////////////////////////
/// Get the current playing position of a sound stream
////////////////////////////////////////////////////////////
float sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream)
sfUint32 sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream)
{
CSFML_CALL_RETURN(soundStream, GetPlayingOffset(), 0.f);
CSFML_CALL_RETURN(soundStream, GetPlayingOffset(), 0);
}

View file

@ -64,7 +64,7 @@ private :
return Continue;
}
virtual void OnSeek(float TimeOffset)
virtual void OnSeek(sfUint32 TimeOffset)
{
if (mySeekCallback)
mySeekCallback(TimeOffset, myUserData);

View file

@ -343,9 +343,9 @@ void sfRenderWindow_SetFramerateLimit(sfRenderWindow* renderWindow, unsigned int
////////////////////////////////////////////////////////////
/// Get time elapsed since last frame of a window
////////////////////////////////////////////////////////////
float sfRenderWindow_GetFrameTime(const sfRenderWindow* renderWindow)
sfUint32 sfRenderWindow_GetFrameTime(const sfRenderWindow* renderWindow)
{
CSFML_CALL_RETURN(renderWindow, GetFrameTime(), 0.f);
CSFML_CALL_RETURN(renderWindow, GetFrameTime(), 0);
}

View file

@ -208,7 +208,7 @@ void sfFtp_Destroy(sfFtp* ftp)
////////////////////////////////////////////////////////////
/// Connect to the specified FTP server
////////////////////////////////////////////////////////////
sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, unsigned short port, float timeout)
sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfUint32 timeout)
{
CSFML_CHECK_RETURN(ftp, NULL);

View file

@ -201,7 +201,7 @@ void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short port)
/// not return instantly; use a thread if you don't want to block your
/// application.
////////////////////////////////////////////////////////////
sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, float timeout)
sfHttpResponse* sfHttp_SendRequest(sfHttp* http, const sfHttpRequest* request, sfUint32 timeout)
{
CSFML_CHECK_RETURN(http, NULL);
CSFML_CHECK_RETURN(request, NULL);

View file

@ -114,7 +114,7 @@ sfIpAddress sfIpAddress_GetLocalAddress(void)
/// distant website ; as a consequence, this function may be
/// very slow -- use it as few as possible !
////////////////////////////////////////////////////////////
sfIpAddress sfIpAddress_GetPublicAddress(float timeout)
sfIpAddress sfIpAddress_GetPublicAddress(sfUint32 timeout)
{
return FromSFMLAddress(sf::IpAddress::GetPublicAddress(timeout));
}

View file

@ -116,7 +116,7 @@ void sfSocketSelector_Clear(sfSocketSelector* selector)
/// This functions will return either when at least one socket
/// is ready, or when the given timeout is over
////////////////////////////////////////////////////////////
sfBool sfSocketSelector_Wait(sfSocketSelector* selector, float timeout)
sfBool sfSocketSelector_Wait(sfSocketSelector* selector, sfUint32 timeout)
{
CSFML_CALL_RETURN(selector, Wait(timeout), sfFalse);
}

View file

@ -106,7 +106,7 @@ unsigned short sfTcpSocket_GetRemotePort(const sfTcpSocket* socket)
////////////////////////////////////////////////////////////
/// Connect a TCP socket to another computer on a specified port
////////////////////////////////////////////////////////////
sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, float timeout)
sfSocketStatus sfTcpSocket_Connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfUint32 timeout)
{
sf::IpAddress address(host.Address);

View file

@ -62,9 +62,9 @@ void sfClock_Destroy(sfClock* clock)
////////////////////////////////////////////////////////////
/// Get the time elapsed for a clock
////////////////////////////////////////////////////////////
float sfClock_GetTime(const sfClock* clock)
sfUint32 sfClock_GetTime(const sfClock* clock)
{
CSFML_CALL_RETURN(clock, GetElapsedTime(), 0.f)
CSFML_CALL_RETURN(clock, GetElapsedTime(), 0)
}

View file

@ -31,9 +31,9 @@
////////////////////////////////////////////////////////////
/// Make the current thread sleep for a given time
/// Make the current thread sleep for a given duration
////////////////////////////////////////////////////////////
void sfSleep(float Duration)
void sfSleep(sfUint32 Duration)
{
sf::Sleep(Duration);
}

View file

@ -317,9 +317,9 @@ void sfWindow_SetFramerateLimit(sfWindow* window, unsigned int limit)
////////////////////////////////////////////////////////////
/// Get time elapsed since last frame of a window
////////////////////////////////////////////////////////////
float sfWindow_GetFrameTime(const sfWindow* window)
sfUint32 sfWindow_GetFrameTime(const sfWindow* window)
{
CSFML_CALL_RETURN(window, GetFrameTime(), 0.f)
CSFML_CALL_RETURN(window, GetFrameTime(), 0)
}

View file

@ -87,7 +87,7 @@ namespace opengl
float y = -window.Input.GetMouseY() * 200.0F / window.Height + 100.0F;
// Apply some transformations
time += window.GetFrameTime();
time += window.GetFrameTime() / 1000.0F;
Gl.glMatrixMode(Gl.GL_MODELVIEW);
Gl.glLoadIdentity();
Gl.glTranslatef(x, y, -100.0F);

View file

@ -74,7 +74,7 @@ Module OpenGL
Dim y = -window.Input.GetMouseY() * 200.0F / window.Height + 100.0F
' Apply some transformations
time += window.GetFrameTime()
time += window.GetFrameTime() / 1000.0F
Gl.glMatrixMode(Gl.GL_MODELVIEW)
Gl.glLoadIdentity()
Gl.glTranslatef(x, y, -100.0F)

View file

@ -50,7 +50,7 @@ namespace window
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
// Apply some transformations
time += window.GetFrameTime();
time += window.GetFrameTime() / 1000.0F;
Gl.glMatrixMode(Gl.GL_MODELVIEW);
Gl.glLoadIdentity();
Gl.glTranslatef(0.0F, 0.0F, -200.0F);

View file

@ -113,10 +113,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Total duration of the music, in seconds
/// Total duration of the music, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float Duration
public uint Duration
{
get {return sfMusic_GetDuration(This);}
}
@ -206,10 +206,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Current playing position, in seconds
/// Current playing position, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float PlayingOffset
public uint PlayingOffset
{
get {return sfMusic_GetPlayingOffset(This);}
set {sfMusic_SetPlayingOffset(This, value);}
@ -272,7 +272,7 @@ namespace SFML
static extern SoundStatus sfMusic_GetStatus(IntPtr Music);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfMusic_GetDuration(IntPtr Music);
static extern uint sfMusic_GetDuration(IntPtr Music);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern uint sfMusic_GetChannelsCount(IntPtr Music);
@ -302,7 +302,7 @@ namespace SFML
static extern void sfMusic_SetAttenuation(IntPtr Music, float Attenuation);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfMusic_SetPlayingOffset(IntPtr Music, float TimeOffset);
static extern void sfMusic_SetPlayingOffset(IntPtr Music, uint TimeOffset);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern bool sfMusic_GetLoop(IntPtr Music);
@ -326,7 +326,7 @@ namespace SFML
static extern float sfMusic_GetAttenuation(IntPtr Music);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfMusic_GetPlayingOffset(IntPtr Music);
static extern uint sfMusic_GetPlayingOffset(IntPtr Music);
#endregion
}
}

View file

@ -151,10 +151,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Current playing position of the sound, in seconds
/// Current playing position of the sound, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float PlayingOffset
public uint PlayingOffset
{
get {return sfSound_GetPlayingOffset(This);}
set {sfSound_SetPlayingOffset(This, value);}
@ -297,7 +297,7 @@ namespace SFML
static extern void sfSound_SetAttenuation(IntPtr Sound, float Attenuation);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfSound_SetPlayingOffset(IntPtr Sound, float TimeOffset);
static extern void sfSound_SetPlayingOffset(IntPtr Sound, uint TimeOffset);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfSound_GetPitch(IntPtr Sound);
@ -318,7 +318,7 @@ namespace SFML
static extern float sfSound_GetAttenuation(IntPtr Sound);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfSound_GetPlayingOffset(IntPtr Sound);
static extern uint sfSound_GetPlayingOffset(IntPtr Sound);
#endregion
}
}

View file

@ -122,10 +122,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Total duration of the buffer, in seconds
/// Total duration of the buffer, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float Duration
public uint Duration
{
get {return sfSoundBuffer_GetDuration(This);}
}
@ -202,7 +202,7 @@ namespace SFML
static extern uint sfSoundBuffer_GetChannelsCount(IntPtr SoundBuffer);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfSoundBuffer_GetDuration(IntPtr SoundBuffer);
static extern uint sfSoundBuffer_GetDuration(IntPtr SoundBuffer);
#endregion
}
}

View file

@ -171,10 +171,10 @@ namespace SFML
////////////////////////////////////////////////////////////
/// <summary>
/// Current playing position, in seconds
/// Current playing position, in milliseconds
/// </summary>
////////////////////////////////////////////////////////////
public float PlayingOffset
public uint PlayingOffset
{
get {return sfSoundStream_GetPlayingOffset(This);}
set {sfSoundStream_SetPlayingOffset(This, value);}
@ -229,9 +229,9 @@ namespace SFML
/// <summary>
/// Virtual function called to seek into the stream
/// </summary>
/// <param name="timeOffset">New position, expressed in seconds</param>
/// <param name="timeOffset">New position, in milliseconds</param>
////////////////////////////////////////////////////////////
protected abstract void OnSeek(float timeOffset);
protected abstract void OnSeek(uint timeOffset);
////////////////////////////////////////////////////////////
/// <summary>
@ -289,11 +289,11 @@ namespace SFML
/// <summary>
/// Called to seek in the stream
/// </summary>
/// <param name="timeOffset">New position, expressed in seconds</param>
/// <param name="timeOffset">New position, in milliseconds</param>
/// <param name="userData">User data -- unused</param>
/// <returns>If false is returned, the playback is aborted</returns>
////////////////////////////////////////////////////////////
private void Seek(float timeOffset, IntPtr userData)
private void Seek(uint timeOffset, IntPtr userData)
{
OnSeek(timeOffset);
}
@ -302,7 +302,7 @@ namespace SFML
private delegate bool GetDataCallbackType(ref Chunk dataChunk, IntPtr UserData);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void SeekCallbackType(float timeOffset, IntPtr UserData);
private delegate void SeekCallbackType(uint timeOffset, IntPtr UserData);
private GetDataCallbackType myGetDataCallback;
private SeekCallbackType mySeekCallback;
@ -355,7 +355,7 @@ namespace SFML
static extern void sfSoundStream_SetAttenuation(IntPtr SoundStream, float Attenuation);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfSoundStream_SetPlayingOffset(IntPtr SoundStream, float TimeOffset);
static extern void sfSoundStream_SetPlayingOffset(IntPtr SoundStream, uint TimeOffset);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern bool sfSoundStream_GetLoop(IntPtr SoundStream);
@ -379,7 +379,7 @@ namespace SFML
static extern float sfSoundStream_GetAttenuation(IntPtr SoundStream);
[DllImport("csfml-audio-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfSoundStream_GetPlayingOffset(IntPtr SoundStream);
static extern uint sfSoundStream_GetPlayingOffset(IntPtr SoundStream);
#endregion
}
}

View file

@ -288,7 +288,7 @@ namespace SFML
/// </summary>
/// <returns>Time elapsed, in seconds</returns>
////////////////////////////////////////////////////////////
public override float GetFrameTime()
public override uint GetFrameTime()
{
return sfRenderWindow_GetFrameTime(This);
}
@ -605,7 +605,7 @@ namespace SFML
static extern void sfRenderWindow_SetFramerateLimit(IntPtr This, uint Limit);
[DllImport("csfml-graphics-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfRenderWindow_GetFrameTime(IntPtr This);
static extern uint sfRenderWindow_GetFrameTime(IntPtr This);
[DllImport("csfml-graphics-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfRenderWindow_SetJoystickThreshold(IntPtr This, float Threshold);

View file

@ -333,9 +333,9 @@ namespace SFML
/// <summary>
/// Get time elapsed since last frame
/// </summary>
/// <returns>Time elapsed, in seconds</returns>
/// <returns>Time elapsed, in milliseconds</returns>
////////////////////////////////////////////////////////////
public virtual float GetFrameTime()
public virtual uint GetFrameTime()
{
return sfWindow_GetFrameTime(This);
}
@ -662,7 +662,7 @@ namespace SFML
static extern void sfWindow_SetFramerateLimit(IntPtr This, uint Limit);
[DllImport("csfml-window-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern float sfWindow_GetFrameTime(IntPtr This);
static extern uint sfWindow_GetFrameTime(IntPtr This);
[DllImport("csfml-window-2", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
static extern void sfWindow_SetJoystickThreshold(IntPtr This, float Threshold);