Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Position/Scaling issue when drawing a CircleShape to Window with Titlebar  (Read 1490 times)

0 Members and 3 Guests are viewing this topic.

Shane

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
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.



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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Position/Scaling issue when drawing a CircleShape to Window with Titlebar
« Reply #1 on: November 30, 2017, 11:56:01 pm »
It's an Intel GPU driver bug. Update your Intel GPU driver to the latest version.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Shane

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Position/Scaling issue when drawing a CircleShape to Window with Titlebar
« Reply #2 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

Thanks eXpl0it3r

 

anything