Closed Domarius closed 3 years ago
You generally can not call any Kha API before calling System.start. But there's an exception for the Display API - you can call Display.init and then use if before initializing Kha properly.
Display.init() now works correctly! Tested on Linux and Windows.
Describe the bug On Linux, I have 2 monitors, 1920x1200 and 1680x1050.
On html5 (from vscode debugging), I get only 1 display, but it's of the correct resolution - 1920x1200. When I build, I correctly get 2 displays (from Display.all) but height and width for both is 3600x1200.
Additionally, a segfault occours in build mode if Display.primary is accessed early in the program eg. in main(), before System.start. Accessing Display.primary from the update loop works though.
To Reproduce On Linux, with more than one monitor;
Expected behavior The correct resolution should be reported for Display.width and Display.height for the individual monitors. Also a segfault should not occour when accessing Display.primary from the start of the program, so we can create a full screen window that matches the primary monitor current resolution, using System.start.
Execution Environment: