SetWindowSize, sets the size of the Display Output Window...
So let's say you have a 1080p Display, you want SetWindowSize( 1920, 1080, 1 )
SetVirtualResolution, sets the Rendering Output Resolution...
So, let's say you want to actually Render at 4K, you would SetVirtualResolution( 3840, 2160 )
GetVirtualWidth and GetVirtualHeight will return whatever the Virtual Resolution is.
Where-as GetDeviceWidth and GetDeviceHeight return the Window Size
SetScissor( 0, 0, 0, 0 ) will use the full display area... the ONLY usage I've considered this being potentially useful for, is creating a "Cinematic" Border which crops the output with Black Borders.
Still even then, it's just as easy to make a Black Image and turn it into Resized Sprites that do the same job.
Note it DOES NOT change the actual Screen Space Coordinates... if it did, then it'd be useful as an Overscan Compensation Tool; while still outputting the same intended Resolution and Window Size.
So yeah... I'd personally recommend just leaving it as above.
GoSub AppGameKit_Default
Global HelloText As Integer = 0
HelloText = CreateText( "Hello" )
SetTextPosition( HelloText, 10.0, 10.0 )
SetTextSize( HelloText, 64.0 )
SetTextColor( HelloText, 255, 255, 255, 255 )
Global RedSprite As Integer = 0
RedSprite = CreateSprite( CreateImageColor( 255, 0, 0, 255 ) )
SetSpriteSize( RedSprite, 2580, 1440 )
SetSpritePosition( RedSprite, 0, 0 )
Global Scale As Float = 0.0
Repeat
SetScissor( GetVirtualWidth() * Scale, GetVirtualHeight() * Scale, GetVirtualWidth() - (GetVirtualWidth() * Scale), GetVirtualHeight() - (GetVirtualHeight() * Scale) )
If GetRawKeyPressed( 37 ) And Not GetRawKeyReleased( 37 )
If Not(Scale = 0.0)
Dec Scale, 0.01
EndIf
EndIf
If GetRawKeyPressed( 39 ) And Not GetRawKeyReleased( 39 )
If Scale < 1.0
Inc Scale, 0.01
EndIf
EndIf
Sync()
Until GetRawKeyPressed( 27 )
End
AppGameKit_Default:
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "TextBox" )
SetWindowSize( 1280, 720, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 2560, 1440 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 1 )
SetScissor( 0, 0, 0, 0 )
UseNewDefaultFonts( 1 )
Return
You can see what I mean with that sample code