SFML community forums

Help => Window => Topic started by: Khaki765 on January 27, 2018, 04:35:44 pm

Title: Window Style::None causes transparent window to show
Post by: Khaki765 on January 27, 2018, 04:35:44 pm
I have just started working with SFML and was trying to create a borderless fullscreen window.

I thought using the following code would work:
VideoMode desktop = VideoMode().getDesktopMode();
RenderWindow window(desktop, "Title", Style::None);

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

but for some reason the app will run but the window wont be visible. I can't click through it but even if i alt-tab and back again it doesnt cause the window to display. I can only assume I have missed out a step or something but both fullscreen and windowed work using this code.

Any help would be appreciated, thank you.

Using: SFML 2.4.2 on Win10 with GeForce 750Ti
Title: Re: Window Style::None causes transparent window to show
Post by: eXpl0it3r on January 27, 2018, 04:42:23 pm
You're not calling clear() or display() which you should. :)

If you're new, it might be useful to work through the official tutorials: https://www.sfml-dev.org/learn.php
Title: Re: Window Style::None causes transparent window to show
Post by: Khaki765 on January 27, 2018, 04:45:27 pm
Ahh yes, thank you.