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

Author Topic: Title bar obscures first 27 pixels of the view  (Read 974 times)

0 Members and 1 Guest are viewing this topic.

Ark771

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Title bar obscures first 27 pixels of the view
« on: April 16, 2019, 04:40:40 pm »
If I draw any object to position (0,0), the first 27 vertical pixels of that object will be obscured by the title bar. If I'm in fullscreen I can see the first 27 pixels.
I am on Windows 10, Visual Studio 2017, using SFML 2.5.1 with the 64bit DLLs (But I've confirmed this also happens with 32bit DLLs)

#include <SFML/Graphics.hpp>

int main(int argc, char** argv[])
{
        sf::RenderWindow window(sf::VideoMode(320, 240), "RectangleTest");

        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                        {
                                // Close window button when clicked
                                window.close();
                        }
                }

                window.clear(sf::Color::Black);

                sf::RectangleShape FirstRect;
                FirstRect.setSize(sf::Vector2f(320, 10));
                FirstRect.setFillColor(sf::Color::Red);
                FirstRect.setPosition(sf::Vector2f(0, 0));

                sf::RectangleShape SecondRect;
                SecondRect.setSize(sf::Vector2f(320, 10));
                SecondRect.setFillColor(sf::Color::Blue);
                SecondRect.setPosition(sf::Vector2f(0, 10));

                sf::RectangleShape ThirdRect;
                ThirdRect.setSize(sf::Vector2f(320, 10));
                ThirdRect.setFillColor(sf::Color::Green);
                ThirdRect.setPosition(sf::Vector2f(0, 20));

                window.draw(FirstRect);
                window.draw(SecondRect);
                window.draw(ThirdRect);

                // Draw here
                window.display();
        }


        return EXIT_SUCCESS;
}
 





For good measure, here's another example with a 20 pixel offset. Notice the red is still partially obscured.

...

                sf::RectangleShape FirstRect;
                FirstRect.setSize(sf::Vector2f(320, 10));
                FirstRect.setFillColor(sf::Color::Red);
                FirstRect.setPosition(sf::Vector2f(0, 20));

                sf::RectangleShape SecondRect;
                SecondRect.setSize(sf::Vector2f(320, 10));
                SecondRect.setFillColor(sf::Color::Blue);
                SecondRect.setPosition(sf::Vector2f(0, 30));

                sf::RectangleShape ThirdRect;
                ThirdRect.setSize(sf::Vector2f(320, 10));
                ThirdRect.setFillColor(sf::Color::Green);
                ThirdRect.setPosition(sf::Vector2f(0, 40));

...
 




eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: Title bar obscures first 27 pixels of the view
« Reply #1 on: April 16, 2019, 05:49:19 pm »
This is an Intel GPU driver bug, happens for every OpenGL application (incl. Qt applications).
Install the latest Intel GPU driver. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Ark771

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Title bar obscures first 27 pixels of the view
« Reply #2 on: April 16, 2019, 06:56:50 pm »
I try to keep things updated, honestly I do. Windows never told me my graphics drivers were outdated, Intel can't diagnose drivers due to my laptop being Dell, and Dell isn't the most intuitive when it comes to graphic driver updates.
But after some digging on Dell's website I got my drivers update and I'm now back in business!
Thanks a ton eXpl0it3r!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: Title bar obscures first 27 pixels of the view
« Reply #3 on: April 16, 2019, 11:57:17 pm »
TBH it's not Windows' responsibility to tell you about driver updates, I usually even disable automatic driver updates, due to Windows installing wrong drivers before.

Generally it's recommend to go to your hardware vendors website and grab the latest version from there. Sadly, some notebook manufacturers cripple their devices, so they won't accept non-branded drivers, leaving those devices in a outdated state.

Glad you go it fixed. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/