I am experimenting, and want to draw 1 million moving asteroids on screen as my goal.
Doing:
void _state_gameplayloop_draw(double delta)
{
TextureAsset *ta = assets_request_texture(ROOTDIR "/assets/star.png");
if (ta) {
for (int i = 0; i < 1000000; i++) {
DrawTexture(ta->texture, 0, 200, WHITE);
}
} else {
log_info("TextureAsset empty!");
}
}
grinds the fps to a halt (the actual png is only loaded once outside the loop). I know the above method is not at all optimal for this, it is just to test the fps when doing it the 'dumb' way.
I want to learn more about Raylib, and low-level graphics, so that I can write more performant code for use-cases like the above.