Page 1 of 1
OpenScreen() always fails
Posted: Thu Dec 05, 2024 1:59 pm
by Little John
Code: Select all
Define.i w, h, d, count=0
If InitSprite() = 0
Debug "Error with InitSprite()"
End
EndIf
If ExamineScreenModes()
While NextScreenMode()
count + 1
If OpenScreen(ScreenModeWidth(), ScreenModeHeight(), ScreenModeDepth(), "Test")
w = ScreenModeWidth()
h = ScreenModeHeight()
d = ScreenModeDepth()
CloseScreen()
Break
EndIf
Wend
EndIf
Debug Str(count) + " screen modes tested"
Debug Str(w) + "x" + Str(h) + "x" + Str(d)
With both PB 6.04 LTS (x64) and PB 6.12 LTS (x64) on my ASUS ZenBook Flip 13 with Windows 11 Pro, I'm getting this result:
51 screen modes tested
0x0x0
There is no known problem with the hardware or with the operating system.
Does anybody have an idea what could be the reason why OpenScreen() does not work?
Re: OpenScreen() always fails
Posted: Thu Dec 12, 2024 7:58 am
by SPH
Code: Select all
Define.i w, h, d, count=0
If InitSprite() = 0
Debug "Error with InitSprite()"
End
EndIf
If ExamineScreenModes()
While NextScreenMode()
count + 1
If OpenScreen(ScreenModeWidth(), ScreenModeHeight(), ScreenModeDepth(), "Test")
w = ScreenModeWidth()
h = ScreenModeHeight()
d = ScreenModeDepth()
Debug Str(w) + "x" + Str(h) + "x" + Str(d)
CloseScreen()
; Break
EndIf
Wend
EndIf
Debug Str(count) + " screen modes tested"
320x200x32
320x240x32
400x300x32
512x384x32
640x400x32
640x480x32
800x600x32
1024x768x32
1152x864x32
1280x600x32
1280x720x32
1280x768x32
1280x800x32
1280x960x32
1280x1024x32
1360x768x32
1366x768x32
1400x1050x32
1440x900x32
1600x900x32
1680x1050x32
1920x1080x32
22 screen modes tested
Re: OpenScreen() always fails
Posted: Thu Dec 12, 2024 5:41 pm
by Little John
@SPH:
It's fine that your code works on
your computer.
However, on
my computer your code yields the same result as my code above, as expected.
Re: OpenScreen() always fails
Posted: Thu Dec 12, 2024 6:08 pm
by Fred
Nowadays, fullscreen is mostly done by using a top borderless window to avoid changing screen resolution as the final rendering speed isn't really impacted. You can try with the DX11 subsystem to see if it works here.
Re: OpenScreen() always fails
Posted: Thu Dec 12, 2024 7:51 pm
by Little John
When using the DirectX11 subsystem, it works fine on my notebook. Many thanks!