Hello Com,
when i try to start a new Thread and open a new window the window
doesn't show anything.
Here the source from the thread:
void Network(void*)
{
unsigned int Port = 2435;
// Ask for server address
sf::IPAddress ServerAddress;
do
{
ServerAddress = "localhost";
}
while (!ServerAddress.IsValid());
std::cin.ignore(10000, '\n');
// Create a socket for exchanging data with the server
sf::SocketTCP Socket;
// Connect to the server
if (Socket.Connect(Port, ServerAddress) != sf::Socket::Done)
return;
// Send messages until we are disconnected
bool Connected = true;
/*
while (Connected)
{
// Let the user write a message
std::string Message;
std::cout << "Say something to the server : ";
std::getline(std::cin, Message);
// Send it to the server
sf::Packet Packet;
Packet << Message;
Connected = (Socket.Send(Packet) == sf::Socket::Done);
}
*/
// Close the socket
Socket.Close();
}
And now some important main source:
// Einstellungen laden
int VideoX = 1024;
int VideoY = 768;
sf::Thread NetworkThread(&Network);
NetworkThread.Launch();
ifstream LoadConfig("Data\\Config.txt");
// LoadConfig >> VideoX;
// LoadConfig >> VideoY;
// Fenster erstellen
sf::RenderWindow App(sf::VideoMode(VideoX, VideoY, 32), "Window", sf::Style::Close);