// End of screen? if (screen_y >= GL_MAX_Y) { // Yes. Scroll // This basically involves copying a part of the screen on the screen itself SDL_Rect temp; temp.x = 0; // X co-ordinate temp.y = FONT_HEIGHT; // Y-cord First Row (In scrolling, the 0th row is replaced by the 1st row) temp.h = GL_MAX_Y; // ...And copy till the last line temp.w = GL_MAX_X; // Width should be the screen // COPY! SDL_BlitSurface(screen, &temp, screen, NULL); // Set X to 0 screen_x = 0; // Set Y to last row screen_y = GL_MAX_Y - FONT_HEIGHT; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)