Update the whole texture with RenderCopy

This commit is contained in:
Francesco Abbate 2021-04-27 15:21:23 +02:00
parent 67f431c69c
commit 9486940082
1 changed files with 1 additions and 1 deletions

View File

@ -182,8 +182,8 @@ void ren_update_rects(RenRect *rects, int count) {
SDL_Rect sr = {.x = r->x, .y = r->y, .w = r->width, .h = r->height};
int32_t *pixels = ((int32_t *) renderer.surface->pixels) + r->x + renderer.surface->w * r->y;
SDL_UpdateTexture(renderer.texture, &sr, pixels, renderer.surface->w * 4);
SDL_RenderCopy(renderer.renderer, renderer.texture, &sr, &sr);
}
SDL_RenderCopy(renderer.renderer, renderer.texture, NULL, NULL);
SDL_RenderPresent(renderer.renderer);
}