16
Graphics / Re: Creating simple 3D objects SFML
« on: April 21, 2019, 02:01:07 am »
Thank you for the video link, it is an exact replica of the kind of 3D rendering I am doing.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Is there any way to shift a sf::Packet into anoter sf::Packet as seen below(figure1)? I am trying to setup a function that takes a sf::Packet as an arguement, stamps a name on the packet, and then sends it to a client. The problem now is that all that data in the data variable(figure 2) is lost when the data variable is shifted into the newPacket variable.sf::Packet data;
std::string name = "Bob";
int age;
data << bob <<age;
sf::Packet FinalPacket;
std::string PacketType = "Name";
FinalPacket << PacketType << data;
figure 2bool SFMLNetwork::sendUDP(sf::Packet data, std::string Type, sf::IpAddress receiver, unsigned short rcvPort)
{
sf::Packet newPacket;
// not sure if data can be shifted into newPacket
newPacket << Type << data;
if (UdpSocket.send(newPacket, receiver, rcvPort) == sf::Socket::Status::Done) {
return true;
}
else {
return false;
}
}