SDL drawing to screen
Posted: Tue Apr 27, 2010 2:30 pm
Hi, I've just started watching your videos on youtube, and just got into programming in SDL. I am currently following the tutorials at lazyfoo, I want to make a box that has a width of 100, and a height of 100, now I know that I use SDL_FillRect(buffer, NULL, 0xAAAAAA); to fill the whole screen, I am wondering that instead of drawing to the buffer I could draw to another object say a box, and then using BlitSurface to draw to the screen. am I on the right track?
Code: Select all
//SDL_FillRect(box, NULL, 0xAAAAAA);
SDL_Rect area = {0, 0, 100, 100};
SDL_BlitSurface(box, &area, buffer, NULL);
SDL_Flip(buffer);