09-20-2025, 12:46 AM
For some reason my program is not doing fullscreen.
My display is 1080p, and _FULLSCREEN works with my test program, but when I try it with my real program, like so:
it doesn't go full screen, or even resize the program window - it stays the same size as when it's screen 0, and it displays 1080p real small, squashed into the little screen 0 program window.
What gives? The only thing different is my real program uses custom fonts. Does _FULLSCREEN not like non-default fonts?
Any help appreciated! The full code to both the real and test programs can be found in the attached ZIP file.
The test program - full screen works fine here:
My display is 1080p, and _FULLSCREEN works with my test program, but when I try it with my real program, like so:
Code: (Select All)
Screen _NewImage(_DesktopWidth, _DesktopHeight, 32): _ScreenMove 0, 0
'Screen _NewImage(cScreenSizeX, cScreenSizeY, 32): _ScreenMove 0, 0
'_FullScreen _Stretch ' *** DIDN'T WORK
_FullScreen _SquarePixels ' *** ALSO DIDN'T WORK
_Dest 0: Cls , _RGB32(0, 0, 0)
it doesn't go full screen, or even resize the program window - it stays the same size as when it's screen 0, and it displays 1080p real small, squashed into the little screen 0 program window.
What gives? The only thing different is my real program uses custom fonts. Does _FULLSCREEN not like non-default fonts?
Any help appreciated! The full code to both the real and test programs can be found in the attached ZIP file.
The test program - full screen works fine here:
Code: (Select All)
' Here are some common 16:9 resolutions:
' 1280 x 720 (720p): A standard high-definition (HD) resolution.
' 1600 x 900 (720p): A less common but still valid 16:9 resolution.
' 1920 x 1080 (1080p/Full HD): The resolution you mentioned.
' 2560 x 1440 (1440p/QHD): A popular, higher-resolution option.
' 3840 x 2160 (4K/UHD): The next step up in resolution for video and displays.
' 7680 x 4320 (8K/UHD): The highest standard resolution available.
' Standard resolutions with the 4:3 aspect ratio:
' 320 x 240 QVGA
' 640 x 480 VGA
' 800 x 600 SVGA
' 1024 x 768 XGA
' 1280 x 1024 SXGA
' Screen 0 color names: Black Blue Green Cyan Red Magenta Brown White Gray LightBlue LightGreen LightCyan LightRed LightMagenta Yellow BrightWhite
$Color:0
Dim in$
'FillScreen
TestScreen 0, 0, "Screen 0"
TestScreen 320, 240, "QVGA"
TestScreen 640, 480, "VGA"
TestScreen 800, 600, "SVGA"
TestScreen 1024, 768, "XGA"
TestScreen 1280, 1024, "SXGA"
TestScreen 1280, 720, "720p"
TestScreen 1600, 900, "HD+"
TestScreen 1920, 1080, "1080p"
TestScreen 0, 0, "back to Screen 0"
TestScreen _DesktopWidth, _DesktopHeight, "_DesktopWidth, _DesktopHeight"
Input "ALL DONE. PRESS ENTER TO EXIT"; in$
System
' /////////////////////////////////////////////////////////////////////////////
Sub TestScreen (Width&, Height&, message$)
Dim in$
Dim ScreenMode$
If Width& > 0 And Height& > 0 And Width& <= _DesktopWidth And Height& <= _DesktopHeight Then
ScreenMode$ = message$ + " (" + _ToStr$(Width&) + ", " + _ToStr$(Height&) + ")"
Print "PRESS ENTER FOR " + ScreenMode$
Input in$
Screen _NewImage(Width&, Height&, 32): _ScreenMove 0, 0
Else
ScreenMode$ = message$ + " (" + _ToStr$(_Width) + ", " + _ToStr$(_Height) + ")"
Print "PRESS ENTER FOR SCREEN 0"
Input in$
Screen 0
End If
FillScreen
Locate 1, 1: Print "SCREEN IS: " + ScreenMode$
Locate 9, 1
Input "PRESS ENTER FOR _FULLSCREEN _Stretch"; in$
_FullScreen _Stretch
Input "PRESS ENTER FOR _FULLSCREEN _Stretch , _Smooth"; in$
_FullScreen _Stretch , _Smooth
Input "PRESS ENTER FOR _FULLSCREEN _SquarePixels"; in$
_FullScreen _SquarePixels
Input "PRESS ENTER FOR _FULLSCREEN _SquarePixels , _Smooth"; in$
_FullScreen _SquarePixels , _Smooth
Input "PRESS ENTER FOR _FULLSCREEN _OFF"; in$
_FullScreen _Off
Print
End Sub ' TestScreen
' /////////////////////////////////////////////////////////////////////////////
Sub FillScreen
Dim iLoop1 As Integer
Dim x, y, width, height As Integer
Dim fg, bg As _Unsigned Long
Dim r, g, b, a As Long
If _PixelSize(0) <> 0 Then
Cls , _RGB32(0, 0, 0)
For iLoop1 = 1 To 10
x = RandomNumber%(0, _Width)
y = RandomNumber%(0, _Height)
width = RandomNumber%(0, _Width / 8)
height = RandomNumber%(0, _Height / 8)
r = RandomNumber%(0, 255)
g = RandomNumber%(0, 255)
b = RandomNumber%(0, 255)
a = RandomNumber%(0, 255)
bg = _RGBA32(r, g, b, a)
DrawRectSolid x, y, width, height, bg
r = RandomNumber%(0, 255)
g = RandomNumber%(0, 255)
b = RandomNumber%(0, 255)
fg = _RGB32(r, g, b)
DrawRectOutline x, y, width, height, fg
Next iLoop1
Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
Else
Cls , Black
End If
Locate 3, 1
Print "_PIXELSIZE(0) = " + _ToStr$(_PixelSize(0))
Print "_Width = " + _ToStr$(_Width)
Print "_Height = " + _ToStr$(_Height)
Print "_DesktopHeight = " + _ToStr$(_DesktopHeight)
Print "_DesktopWidth = " + _ToStr$(_DesktopWidth)
Print
End Sub ' FillScreen
' /////////////////////////////////////////////////////////////////////////////
' Generate random value between Min and Max inclusive.
Function RandomNumber% (Min%, Max%)
Dim NumSpread%
' SET RANDOM SEED
Randomize Timer
NumSpread% = (Max% - Min%) + 1
RandomNumber% = Int(Rnd * NumSpread%) + Min% ' GET RANDOM # BETWEEN Max% AND Min%
End Function ' RandomNumber%
' /////////////////////////////////////////////////////////////////////////////
Sub InitImage (ThisImage&, iWidth&, iHeight&, bgColor~&)
FreeImage ThisImage&
ThisImage& = _NewImage(iWidth&, iHeight&, 32)
_Dest ThisImage&: Cls , bgColor~&
End Sub ' InitImage
' /////////////////////////////////////////////////////////////////////////////
Sub FreeImage (ThisImage&)
If ThisImage& < -1 Or ThisImage& > 0 Then _FreeImage ThisImage&
End Sub ' FreeImage
' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D RECTANGLE (OUTLINE)
' DrawRectOutline x, y, width, height, color
Sub DrawRectOutline (iX As Integer, iY As Integer, iSizeW As Integer, iSizeH As Integer, fgColor As _Unsigned Long)
Line (iX, iY)-(iX + iSizeW, iY + iSizeH), fgColor, B ' Draw rectangle outline
End Sub ' DrawRectOutline
' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D RECTANGLE (SOLID)
' DrawRectSolid x, y, width, height, color
Sub DrawRectSolid (iX As Integer, iY As Integer, iSizeW As Integer, iSizeH As Integer, fgColor As _Unsigned Long)
Line (iX, iY)-(iX + iSizeW, iY + iSizeH), fgColor, BF ' Draw a solid rectangle
End Sub ' DrawRectSolid


