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

#1
Hi ! :)

I just installed tgui and i have a very strange problem : i always got a black screen trying to run the library. To solve this, i tried to reduce the nb of lines to isolate the problem.

This is my code (very simple) :

#include <TGUI/TGUI.hpp>

void loadWidgets( tgui::Gui& gui )
{
    tgui::EditBox::Ptr editBoxUsername(gui, L"Username");
}

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

    loadWidgets(gui);

    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(255,123,40)); // I draw in orange to test the problem

        window.display();
    }

    return EXIT_SUCCESS;
}


This code is giving me black screen. However, if i delete the line "loadWidgets(gui);" (just creating an editbox), the screen is orange (as it should be). I find this very strange... how just creating a new object (not even drawing it) could interfere with the render of my application ?

I'm working with Code::Blocks, tgui 0.6 downloaded with MinGW precompiled libraries.

Do you have any idea or suggestion ?  :o