Hello together,
ive used tgui and i have a little problem. If I close my window the game crashes and i see the follow error message:

This is my code:
The programm works perfectly until i close it.
Sorry for my bad english, im from germany
ive used tgui and i have a little problem. If I close my window the game crashes and i see the follow error message:

This is my code:
Code Select
#include <SFML\Graphics.hpp>
#include <TGUI\TGUI.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(800, 600), "TestFenster");
tgui::Gui gui(window);
gui.setGlobalFont("font.ttf");
tgui::Label::Ptr labelUsername(gui);
labelUsername->setText("Username:");
labelUsername->setPosition(200, 100);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed){
window.close();
}
gui.handleEvent(event);
}
window.clear(sf::Color(120, 120, 120, 32));
gui.draw();
window.display();
}
}The programm works perfectly until i close it.
Sorry for my bad english, im from germany