Programm crashes if Window close
« on: 02 December 2014, 18:52:41 »
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:
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

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Programm crashes if Window close
« Reply #1 on: 02 December 2014, 18:56:18 »
All crashes that I have seen so far on windows were related to incompatible settings in tgui and sfml.
So you should double check everything mentioned here and answer the questions at the end if you are sure that everything is setup correctly. https://forum.tgui.eu/index.php?topic=216.msg1092#msg1092

Re: Programm crashes if Window close
« Reply #2 on: 02 December 2014, 21:13:22 »
I did copy the false DLLs to my Programm, but i did include the right libs. Now the Programm dont crash :D
Thanks for your awesome GUI-Libary <3.