Skip to content

Commit

Permalink
Update main.c
Browse files Browse the repository at this point in the history
  • Loading branch information
plter committed Oct 19, 2020
1 parent 2c70b26 commit 4341c64
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions L04DrawText/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@

SDL_Texture *text;

void drawBackground(SDL_Renderer *renderer) {
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
SDL_Rect rect = {0, 0, WIDTH, HEIGHT};
SDL_RenderFillRect(renderer, &rect);
}

void draw(SDL_Renderer *renderer) {
drawBackground(renderer);

SDL_Rect r;
SDL_QueryTexture(text, NULL, NULL, &r.w, &r.h);
r.x = (WIDTH - r.w) / 2;
Expand Down Expand Up @@ -80,6 +72,7 @@ int main() {
}

while (1) {
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
SDL_RenderClear(renderer);
draw(renderer);
SDL_RenderPresent(renderer);
Expand Down

0 comments on commit 4341c64

Please sign in to comment.