SFML community forums

Help => General => Topic started by: Shane on November 30, 2017, 07:42:36 pm

Title: Position/Scaling issue when drawing a CircleShape to Window with Titlebar
Post by: Shane on November 30, 2017, 07:42:36 pm
Drawing a circleshape to a renderwindow when the window has a title bar the size / scaling is to big. If the windows has sf:style::None (removing the title bar) the shape is rendered correctly. It appears the circleshape is being scaled to fit the windows size including the size of the title bar. A printf of the window size displays the correct size in both cases. See an image illustrating the issue below.

(https://image.prntscr.com/image/6yAvYRq8RwGf8wGsAxHfLw.png)

Has anyone else experienced this issue?  or have a solution?

Environment
Lenovo P50s Laptop
Display Adapter: Intel HD Graphics 520 (driver version 21.20.16.4678)
Windows 10 (version 10.0.16299.64)
Visual Studio 2017
SFML 2.4.2 (64x)

Here is the Main.cpp

#include <SFML/Graphics.hpp>

int main()
{
        sf::RenderWindow window(sf::VideoMode(200, 200),"SFML works!", sf::Style::None);
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);
       
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                window.clear(sf::Color::Magenta);
                window.draw(shape);
                window.display();
        }

        return 0;
}
 
Title: Re: Position/Scaling issue when drawing a CircleShape to Window with Titlebar
Post by: eXpl0it3r on November 30, 2017, 11:56:01 pm
It's an Intel GPU driver bug. Update your Intel GPU driver to the latest version.
Title: Re: Position/Scaling issue when drawing a CircleShape to Window with Titlebar
Post by: Shane on December 01, 2017, 04:10:44 am
You are absolutely right.  Updated the driver and problem solved. 

If anyone is interest I found the Intel Graphics Driver Bug Report about this on the Intel Developer Zone

https://software.intel.com/en-us/forums/graphics-driver-bug-reporting/topic/737972 (https://software.intel.com/en-us/forums/graphics-driver-bug-reporting/topic/737972)

Thanks eXpl0it3r