Global xwin = 1920Global ywin = 1080SetDisplayAspect( xwin / ywin ) // set aspect ratio SetVirtualResolution( xwin, ywin ) // set VR ( if lower than window size it will scale up )SetScissor( 0, 0, xwin, ywin ) // use the maximum available screen space, no bordersSetClearColor( 0, 0, 0 ) // dark backgroundSetBorderColor( 0, 0, 15 ) // some systems might need a border so set a colourSetWindowSize( xwin, ywin, 1 ) // set resolution - 0 for a windowed game
That's good news. I don't want to put in the effort and notice mid way I need to redo all assets or code
QuoteThat's good news. I don't want to put in the effort and notice mid way I need to redo all assets or code Yes that was my goal too so I tested AGK's commands and they work as expected. I would just target 1920 X 1080 and let AGK take care of the rest.
//SET UP GRAPHICS//game is optimized for 480x270global resX as integer = 480global resY as integer = 270global gameResX as integer = 1920global gameResY as integer = 1080global fullscreen as integer = 1SetUpGraphics()function SetUpGraphics() //calculate correct aspect ratio SetDisplayAspect(resX / resY) //set the optimized resolution SetVirtualResolution(resX,resY) //this can be set however you/the user likes it SetWindowSize(gameResX,gameResY,fullscreen) //60 fps SetSyncRate(60,1)endfunction
// Project: Test // Created: 20-06-13#Constant KEY_ESC 27#Constant IN_PLAY 1#Constant QUIT 2//SET UP GRAPHICS//game is optimized for 480x270global resX as integer = 480global resY as integer = 270global gameResX as integer = 1920global gameResY as integer = 1080global fullscreen as integer = 1SetUpGraphics()function SetUpGraphics() //calculate correct aspect ratio SetDisplayAspect(resX / resY) //set the optimized resolution SetVirtualResolution(resX,resY) //this can be set however you/the user likes it SetWindowSize(gameResX,gameResY,fullscreen) // background colour SetClearColor( 147, 168, 172 ) //60 fps SetSyncRate(60,1) // turn on vsync SetVSync(1)endfunctionSetUpGraphics()pot_image = LoadImage( "Pot.png" )pot_sprite = CreateSprite( pot_image )x As Float = -16.0y As Float = 100.0SetSpritePosition( pot_sprite, x, y )game_mode = IN_PLAYRepeat If( GetRawKeyState(KEY_ESC) ) Then game_mode = QUIT SetSpritePosition( pot_sprite, x, y ) If( x < 480.0 - 45.0 ) Then x = x + 0.5 Sync()Until game_mode = QUIT
No I don't get any tearing, are you using Sync() more than once? This works without tearing.
SetVSync(1)
SetSyncRate and SetVsync shouldn´t work both together.
SetSyncRate(60,1)
function SetUpGraphics() //calculate correct aspect ratio SetDisplayAspect(resX / resY) //set the optimized resolution SetVirtualResolution(resX,resY) //this can be set however you/the user likes it SetWindowSize(gameResX,gameResY,fullscreen) // background colour SetClearColor( 147, 168, 172 ) // turn off smoothing filter SetDefaultMinFilter( 0 ) SetDefaultMagFilter( 0 ) //60 fps SetSyncRate(60,1) // turn on vsync SetVSync(1)endfunction