The thing is i just wanted to add wxwidgets window with debug information such as UPS, number of players etc. to my server app, as the console output isnt very clear to deal with in this case.
In the following code, app object is my server class. Important thing is I dont want to change anything inside it, so that without any effort i can still compile it without gui in another project.
bool cApp::OnInit()
{
// Create an instance of our frame, or window
cMainFrame *mainWin = new cMainFrame(_("server"), wxDefaultPosition, wxSize(600, 500));
mainWin->Show(true); // show the window
SetTopWindow(mainWin); // and finally, set it as the main window
app = new App();
app->go(); //init server class
return true;
}
This is my thread initialization code, it is called just before the main loop inside App class.
sf::Thread thread(&App::acceptConnections,this);
thread.launch();
Thanks for your time:)