SFML community forums

Help => Window => Topic started by: Moldytzu on October 09, 2021, 07:45:11 pm

Title: Window only updates when I move the cursor over it
Post by: Moldytzu on October 09, 2021, 07:45:11 pm
Hi guys!

I'm a beginner with SFML and I made a basic game. The problem is that window only updates when I move the cursor over it. The code in the main function is

int main()
{
    new (&window) sf::RenderWindow(sf::VideoMode(800, 600), "My ugly game made with SFML");
    sf::Clock clock;
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        drawEvent();
        window.display();
    }

    return 0;
}
 

And also I'm running Ubuntu 20.04 LTS with Openbox and LXDE.
Title: Re: Window only updates when I move the cursor over it
Post by: Moldytzu on October 09, 2021, 09:17:46 pm
Fixed. I had to add context settings to the window and then it worked. Strange but it works.