Black screen when loading widgets

Started by Faellan, 26 March 2014, 19:31:03


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);


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


        window.clear(sf::Color(255,123,40)); // I draw in orange to test the problem


    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


Thats really strange.

Are you sure that you are using the sfml libraries included in the tgui download?
Are you linking statically or dynamically, in debug or release mode?
You are using MinGW 4.7.1, right?

I'll try it on my windows as well and see if I can reproduce the problem.


It seems to work fine here.
If you can't solve the problem then you can send me the .cbp file and maybe I can find a mistake in it.


Hi !

Well, i unistalled all my tgui files and re-downloaded them totally and it seems to work now, i don't know what was the problem, ty for the support and nice lib ! :D