Chiciałem móc korzystać z wielu okien więc napisałem funkcje, tworzątcą okna:
int MessageBox(int x,int y, int width, int height, std::string title, std::string message, int type)
{
sf::RenderWindow messagebox(sf::VideoMode(width, height), title);
while (messagebox.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event1;
while (messagebox.pollEvent(event1))
{
// "close requested" event: we close the window
if (event1.type == sf::Event::Closed)
messagebox.close();
}
}
messagebox.setActive();
messagebox.display();
messagebox.clear();
return 0;
}
Po jej wywołaniu powstaje okno jednak nie reaguje na kliknięcia (to nowe okno).
co zrobić by pojawiające się okno było aktywne a ie to główne?