Created
November 16, 2017 20:41
-
-
Save Mikepicker/0c8c2098d570d68520c5a65b0a0f2ef0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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