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

Author Topic: Resolution Bug after creating window with valid mode  (Read 3230 times)

0 Members and 1 Guest are viewing this topic.

Daniel Schreiber Mendes

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Resolution Bug after creating window with valid mode
« on: October 14, 2019, 06:53:57 pm »
Hey,
 when I create a window with
sf::VideoMode::getFullscreenModes()[0]
 
everything is fine. But when I choose another index than 0, the following happens:
My screen turns black for a second and on the upper left corner the console is displayed for a fraction of a second. After that the window works fine with the wanted resolution. After I close the window though my whole desktop is getting displayed in the resolution that I've chosen for my window. I can reverse this by running the program again with the first fullscreen mode or by restarting.  The index is valid; there are about 44 valid fullscreen modes available.
What am I doing wrong?

The program is running on a quite old hp with Ubuntu 18.04 installed.

Thanks for all answers! :)

Daniel
« Last Edit: October 14, 2019, 07:06:08 pm by Daniel Schreiber Mendes »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Resolution Bug after creating window with valid mode
« Reply #1 on: October 15, 2019, 07:24:14 pm »
Although, as far as I'm aware, the display's resolution should automatically reset when the program closes, there is a specific video mode that allows you to store the desktop mode, which you can use later to restore it.

sf::VideoMode::getDesktopMode()
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Daniel Schreiber Mendes

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Resolution Bug after creating window with valid mode
« Reply #2 on: October 16, 2019, 05:23:37 pm »
Yeah that works but there is still this annoying bug when opening the window.  :'(

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Resolution Bug after creating window with valid mode
« Reply #3 on: October 20, 2019, 11:14:53 pm »
You mean the going black while changing monitor's fullscreen resolution? That sounds pretty common to me.
If the problem is the console, it would of course depend on which OS you are using but you should be able to create a window without one.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*