Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - tmm

#1
Help requests / Renderwindow Exceptions
14 March 2014, 14:15:26
Hi,

first of all thank you for providing TGUI. It looks awesome ;)

Now to my problem. I just made a little game with sfml and Visual Studio 2012.
I just downloaded your precompiled libs.
And got it working fine, untill I close the RenderWindow.
Something like Heap damaged.

So I just started to play around with shared_ptr and and and.. nothing worked..

Then I got other errors from just calling the window.clear() or draw some other stuff.
And I made a new Project to just test TGUI.

But now I can't even get the tutorial programm running :( It seems like some window methods do cause exceptions. Please help me:

int main()
{
    // Create the window
    sf::RenderWindow window(sf::VideoMode(800, 600), "Window");
    tgui::Gui gui(window);

   /*
if (gui.setGlobalFont("arial.ttf")  == false){
      std::cout << "Main(): Can't find font!\n";
      throw new std::exception("Client_Root: Can't find font!");
   }
   */
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();

            // Pass the event to all the widgets (if there would be widgets)
            gui.handleEvent(event);
        }

       window.clear();

        // Draw all created widgets
        gui.draw();

        window.display();
      
    }

    return EXIT_SUCCESS;
}

throwing exceptions on:

window.clear()
window.close()
window.display()


Hope it's not a very embarrasing mistake of mine  :P :-[