Smooth Scrolling?

BlitzMax Forums/BlitzMax Beginners Area/Smooth Scrolling?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I've narrowed it down , all variables are ints and I have tried forcing vsync on / off and application preference in the driver.

The scrolling is as smooth as I can get if my mainloop is this
While Not KeyHit(KEY_ESCAPE)
'Automatic scroll
pos=pos+direction

If pos=0 Or pos=256 Then direction=-direction

map.draw(pos,pos)

Flip

Wend

But as soon as I control the scrolling with keypresses the scrolling keeps stopping intermittently for a split second at random intervals...
While Not KeyHit(KEY_ESCAPE)
'Using keys
If KeyDown(KEY_LEFT) Then pos=pos+1
If KeyDown(KEY_RIGHT) Then pos=pos-1

map.draw(pos,pos)

Flip

Wend

Could there be some sort of latency or mis-reading of the keyboard going on here?

[Edit] And I've just noticed that in the automatic scrolling example, if I press keys on the keyboard this too makes the scrolling 'hiccup' for a split second.