Hi,
Everytime I try to switch into fullscreen mode, at the same max resolution as my windows 10 desktop (1920x1080), the screen blinks and the application switch to an undersample resolution. But if I print on screen the resolution of the mode, it displays 1920x1080...and same thing for the window size.
Here is a screenshot (that seems correct, and that is weird).
BUT it it not what I see on screen : on screen I see the same image but under sampled, with big pixels, something like :
It's weird because it seems that the resolution is recognized... But it is not the case. It's a smaller resolution, and the 1920x1080 window is mapped to this new resolution.
And when I switch back to window 10, during a moment, I see that I was not in 1920x1080 anymore (big icons, big toolbar) before desktop restores its max resolution...
Any idea ?
My GPU is Nvidia GTX1060 and it works correctly in any game in full res, fullscreen.
Here is my code :
#include <SFML/Graphics.hpp>
int main()
{
auto& fsmode = sf::VideoMode::getFullscreenModes()[0];
sf::RenderWindow window(fsmode, "Fullscreen Demo", sf::Style::Fullscreen);
sf::Text message;
sf::Font font;
font.loadFromFile("arial.ttf");
message.setFont(font);
message.setString(
"resolution:" + std::to_string(fsmode.width) + "x" + std::to_string(fsmode.height) + "\n"
+"window:" + std::to_string(window.getSize().x) + "x" + std::to_string(window.getSize().y)
);
message.setCharacterSize(100);
message.setFillColor(sf::Color::White);
message.setPosition(10, 10);
sf::CircleShape circleRed(50);
circleRed.setFillColor(sf::Color(255, 0, 0));
circleRed.setPosition(100, 100);
double t = 0.0;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (event.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::KeyReleased:
if (event.key.code == sf::Keyboard::Key::Escape)
window.close();
break;
}
}
window.clear();
window.draw(circleRed);
window.draw(message);
window.display();
}
return 0;
}