Usdx: Screen not correctly initialized on startup - MacOs 10.15.2

Created on 22 Dec 2019  路  4Comments  路  Source: UltraStar-Deluxe/USDX

Actual behaviour

When USDX starts in full screen modus, the screen is shifted up, showing a black band at the bottom.
After going to the options, graphics menu and simply going back to the previous menu, the screen is re-initialized and correctly displayed.

Expected behaviour

At startup, the screen should display correctly centered.

Steps to reproduce

  1. open USDX app

workaround:

  1. go to tools > options > graphics
  2. go back
  3. the screen is now correctly displayed: no black band.

Details

  • USDX version:
  • Operating System + version:
    os: MacOs Catalina - 10.15.2
    install the latest sdl2, using "brew install --HEAD sdl2"
    (see https://github.com/UltraStar-Deluxe/USDX/issues/492)
  • Machine: MacBook Pro 2019

Most helpful comment

I found a fix that worked for me.

When you press the "back" button on the Graphics Options screen, the screen seems to be reinitialized because of which the screen suddenly displays correctly. With this finding as basis I dived into the code.
It appears that at code level the underlying action is located in UScreenOptionsGraphics.pas, below "SDLK_RETURN". It's "UGraphic.UpdateVideoMode()" that actually does the trick.

The problem described under this ticket is fixed for me by adding next lines in UGraphic.pas, at the end of the "Initialize3D" procedure (around line 550):

  // work around to force a good screen initialization on MacOS
  {$IFDEF MACOS}
  UpdateVideoMode();
  {$IFEND}

Testing fullscreen and window mode show now both screens that are filled to the corners instead of 1/4th or shifted up.

All 4 comments

Screen with black band at startup:
Schermafbeelding 2019-12-22 om 16 21 19

After coming back from the graphics menu:
Schermafbeelding 2019-12-22 om 16 21 23

It looks like lots of screen scaling and related issues are still under investigation at SDL2. At the time of writing none of the code changes resulted in resolving the issue.

https://bugzilla.libsdl.org/show_bug.cgi?id=4822

please note: I used below the commands to install the development head version of SDL2:

brew unlink sdl2
brew install mercurial
brew install --HEAD sdl2

I found a fix that worked for me.

When you press the "back" button on the Graphics Options screen, the screen seems to be reinitialized because of which the screen suddenly displays correctly. With this finding as basis I dived into the code.
It appears that at code level the underlying action is located in UScreenOptionsGraphics.pas, below "SDLK_RETURN". It's "UGraphic.UpdateVideoMode()" that actually does the trick.

The problem described under this ticket is fixed for me by adding next lines in UGraphic.pas, at the end of the "Initialize3D" procedure (around line 550):

  // work around to force a good screen initialization on MacOS
  {$IFDEF MACOS}
  UpdateVideoMode();
  {$IFEND}

Testing fullscreen and window mode show now both screens that are filled to the corners instead of 1/4th or shifted up.

Awesome! Please create a pull request for this change.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

natowi picture natowi  路  4Comments

RattleSN4K3 picture RattleSN4K3  路  4Comments

deuteragenie picture deuteragenie  路  9Comments

bohning picture bohning  路  6Comments

bohning picture bohning  路  8Comments