Post Reply 
Smooth scrolling
02-01-2014, 08:15 AM
Post: #1
Smooth scrolling
I've added scrolling to my Cellular Automaton program I did a while ago. However, the result is somewhat disappointing: the scrolling produces quite some flickering. Here is a small test program that shows the same effect:

Code:
EXPORT Flicker()
BEGIN
  LOCAL X,Y;
  DIMGROB_P(G1,320,240);
  RECT_P(G1,0,0,320,240,#0);
  Y:=-1;
  FOR I FROM 1 TO 960 DO
    IF Y=239 THEN
      BLIT_P(G1,G1,0,1,320,240);
    ELSE
      Y:=Y+1;
    END;
    FOR X FROM 0 TO 319 DO
      PIXON_P(G1,X,Y,RGB(RANDINT(0,255),RANDINT(0,255),RANDINT(0,255)));
    END;    
    BLIT_P(G0,G1,0,0,320,240);
    IF ISKEYDOWN(4) THEN
      BREAK;
    END;
  END;
END;

From my old days I remember that you could synchronize screen updates with the CRT's vertical refresh, i.e., update the screen while the electronic beam was moving from the bottom right to the top left. I don't know if such an approach would also be possible for the Prime? Have TFT displays also such a refresh cycle like CRTs? Or is there something wrong with my program? Smooth scrolling would be such a nice thing to have for game programming and other fun stuff ...
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)