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 - Max

#1
I have a simple code, but it throws an exception in gui.draw()

#include <TGUI/TGUI.hpp>

/////////////////////////////////////////////////////////////////////////////////////////////////////

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "TGUI demo");
    tgui::Gui gui(window);

    if (gui.setGlobalFont("arial.ttf") == false)
       return 1;

    // Load all the widgets from a file
   if (gui.loadWidgetsFromFile("form.txt") == false)
   return 1;

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();

            gui.handleEvent(event);
        }

        window.clear();
        gui.draw();
        window.display();

        sf::sleep(sf::milliseconds(1));
    }

    return EXIT_SUCCESS;
}