I stumbled upon this problem by accident when I forgot to put in a REDRAW inside a loop, resulting in very sluggish system response.
I appears that if you put a GRAPHIC CLEAR statement inside a loop with the REDRAW option (writing to the graphic buffer instead of the screen), and then don't actually REDRAW the screen each iteration, the system becomes VERY sluggish. However, if you REDRAW each iteration, everything works fine.
Here is some example code to show the problem:
With the GRAPHIC REDRAW REMmed out, the GRAPHIC INKEY$ function is VERY sluggish, but if you enable GRAPHIC REDRAW, all is fine.
It should work either way, as all that is happening without the GRAPHIC REDRAW is that the off screen buffer is being overwritten over and over again, nothing more. Or at least, that is what SHOULD be happening. But apparently something else is going on with the buffer when it is not transferred after being fully written, and is then written again.
Anyone else get this result?
I appears that if you put a GRAPHIC CLEAR statement inside a loop with the REDRAW option (writing to the graphic buffer instead of the screen), and then don't actually REDRAW the screen each iteration, the system becomes VERY sluggish. However, if you REDRAW each iteration, everything works fine.
Here is some example code to show the problem:
Code:
#COMPILE EXE FUNCTION PBMAIN () AS LONG DESKTOP GET CLIENT TO w&, h& background??? = RGB(0, 0, 255) GRAPHIC WINDOW "", 0, 0, w&, h& TO MyWindow??? GRAPHIC ATTACH MyWindow???, 0, REDRAW DO GRAPHIC CLEAR background??? 'GRAPHIC REDRAW GRAPHIC INKEY$ TO a$ LOOP UNTIL a$ <> "" END FUNCTION
With the GRAPHIC REDRAW REMmed out, the GRAPHIC INKEY$ function is VERY sluggish, but if you enable GRAPHIC REDRAW, all is fine.
It should work either way, as all that is happening without the GRAPHIC REDRAW is that the off screen buffer is being overwritten over and over again, nothing more. Or at least, that is what SHOULD be happening. But apparently something else is going on with the buffer when it is not transferred after being fully written, and is then written again.
Anyone else get this result?
Comment