mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 21:16:13 +01:00
PR 1641 Added method to get the current read position of sf::Packet
This commit is contained in:
1 parent
e606b52c39
commit
7d2ebaf265
2 files changed
+19
No files matched your search
@@ -69,6 +69,18 @@ CSFML_NETWORK_API void sfPacket_destroy(sfPacket* packet);
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes);
|
CSFML_NETWORK_API void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the current reading position in the packet
|
||||||
|
///
|
||||||
|
/// The next read operation will read data from this position
|
||||||
|
///
|
||||||
|
/// \return The byte offset of the current read position
|
||||||
|
///
|
||||||
|
/// \see append
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_NETWORK_API size_t sfPacket_getReadPosition(const sfPacket* packet);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Clear a packet
|
/// \brief Clear a packet
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -60,6 +60,13 @@ void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
size_t sfPacket_getReadPosition(const sfPacket* packet)
|
||||||
|
{
|
||||||
|
CSFML_CALL_RETURN(packet, getReadPosition(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void sfPacket_clear(sfPacket* packet)
|
void sfPacket_clear(sfPacket* packet)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user