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

Author Topic: Window behavior.  (Read 2853 times)

0 Members and 1 Guest are viewing this topic.

ppnl

  • Newbie
  • *
  • Posts: 3
    • View Profile
Window behavior.
« on: January 24, 2023, 10:36:03 am »
What is the following code suppose to do?

#include <SFML/Graphics.hpp>
using namespace sf;

int main()
{
   VideoMode vm(1920, 1080);
   RenderWindow window(vm, "Test!!!", Style::Fullscreen);

   while(window.isOpen())
   {
      if(Keyboard::isKeyPressed(Keyboard::Escape))
      {
         window.close();
      }

      window.clear();
   }

   return 0;
}
 

My understanding is that it should open a full screen borderless window with a resolution of 1920 by 1080. Instead it opens a smaller borderless window in the upper left corner. It is probably 1920 by 1080 pixels but at the resolution of my desktop which is 3840 by 2160. Some open windows on my desk top are descaled as if they were on a 1920 by 1080 desktop when the program is run.

Is this expected behavior? How do you get a 1920 by 1080 full screen window to open? 
« Last Edit: January 26, 2023, 08:27:05 am by eXpl0it3r »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Window behavior.
« Reply #1 on: January 26, 2023, 08:26:45 am »
What OS are you running on?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

ppnl

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Window behavior.
« Reply #2 on: January 26, 2023, 11:06:45 am »
What OS are you running on?

Thanks but I think I have it sorted. It is an old ugly about how full screen mode works. Turns out that  even deciding  how it should work is complicated. Being new to both object oriented programming and graphics programming made it a real rats nest.