OpenScreen() always fails

Windows specific forum
Little John
Addict
Addict
Posts: 4786
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

OpenScreen() always fails

Post 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?
User avatar
SPH
Enthusiast
Enthusiast
Posts: 566
Joined: Tue Jan 04, 2011 6:21 pm

Re: OpenScreen() always fails

Post 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"
:wink:
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

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
Little John
Addict
Addict
Posts: 4786
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: OpenScreen() always fails

Post 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.
Fred
Administrator
Administrator
Posts: 18199
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: OpenScreen() always fails

Post 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.
Little John
Addict
Addict
Posts: 4786
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: OpenScreen() always fails

Post by Little John »

When using the DirectX11 subsystem, it works fine on my notebook. Many thanks!
Post Reply