This is pretty much the code I use when setting up the screen resolution
Type _screen_type
width as integer
height as integer
edge_left as integer
edge_right as integer
edge_top as integer
edge_bottom as integer
endtype
screen as _screen_type
//set initial resolution and window size
screen.width = 1280
screen.height = 720
//set display properties
SetVirtualResolution(screen.width,screen.height)
SetOrientationAllowed(0,0,1,0)
//screen bounds
screen.edge_left = GetScreenBoundsLeft()
screen.edge_right = GetScreenBoundsRight()
screen.edge_top = GetScreenBoundsTop()
screen.edge_bottom = GetScreenBoundsBottom()
setScissor(screen.edge_left,screen.edge_top,screen.edge_right,screen.edge_bottom)
//calculate new screen size
screen.width = screen.edge_right - screen.edge_left
screen.height = screen.edge_bottom - screen.edge_top
do
print("screen.edge_left = " + str(screen.edge_left))
print("screen.edge_right = " + str(screen.edge_right))
print("screen.edge_top = " + str(screen.edge_top))
print("screen.edge_bottom = " + str(screen.edge_bottom))
print("screen.width = " + str(screen.width))
print("screen.height = " + str(screen.height))
sync()
loop
I hard code an initial resolution then determine the screen bounds then use those screen bounds with the setscissor command. I then calculate the new screen width and height.
By keeping the screen boundary values in variables they can be use to detect when sprites go off the screen or for positioning HUD elements and so on..
Hope this makes sense.