Skip to content

Instantly share code, notes, and snippets.

@Mikepicker
Created November 16, 2017 20:41
Show Gist options
  • Save Mikepicker/0c8c2098d570d68520c5a65b0a0f2ef0 to your computer and use it in GitHub Desktop.
Save Mikepicker/0c8c2098d570d68520c5a65b0a0f2ef0 to your computer and use it in GitHub Desktop.
void render() {
// Clear screen
SDL_RenderClear(gRenderer);
// Render bullets
for (int i = 0; i < BULLET_COUNT; i++) {
if (bullets[i].alive) {
SDL_Rect dstBullet = { .x = bullets[i].x, .y = bullets[i].y, .w = bulletWidth, .h = bulletHeight };
SDL_RenderCopy(gRenderer, bulletTexture, NULL, &dstBullet);
}
}
// Update the screen
SDL_RenderPresent(gRenderer);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment