Hi!

I write some text to the window, when a user taps onto the screen, I
scroll the text up/down a line. For archiving this is do the following:

- setting the text/lookupbuffers
- getting a new line of text
- erasing the screen
- writing text in a loop onto the window.

But this is rather to slow.

Is there anyting like double buffering or s.th else, what would make it
more "fluid" to the user?

Here is my actual code:

void scrollDownLine(void)
{
        int stringLen;
        int lineCount;
        RectangleType rect;     
        RectanglePtr r;
        BytePtr sourceP;        

        r = ▭                              // set rectangle 
        RctSetRectangle(r, 0, 0, 160, 148);     //

        // Move up old lines of text in textbuffer
        MemMove( &stringBuffer[0][0], 
                 &stringBuffer[1][0], (lines - 1)*100 );

        // Move up old stringLength lookuptable
        MemMove( &stringsTable[0], &stringsTable[1], 
                 19 * sizeof(int));
        
        // get beginning of new text in buffer
        sourceP = bufferTail;
        
        // get a fitting line of text
        stringLen = prepareLine( (BytePtr)&stringBuffer[lines-1][0], 
                                 &sourceP, 4096);
        
        // save new beginning in buffer
        bufferTail = sourceP;
        
        // save length of new string 
        stringsTable[lines -1] = stringLen;

        // now erase window
        WinEraseRectangle(r, 0);

        // draw the chars       
        for ( lineCount = 0 ; lineCount < lines ; lineCount++ )
        {
                WinDrawChars( &stringBuffer[lineCount][0], 
                              stringsTable[lineCount], startx, 
                              lineCount * fontHeight );
        }
}

Thanks in advance,
bexxx

Reply via email to