Witajcie zrobiłem sobie funkcje pokazywania obrazka, na którym jest śnieg na losowych miejscach w programie.
void snow(SDL_Surface *surface)
{
int x, y;
srand((unsigned)time);
surface = load_bmp("snieg.bmp");
for(int i = 0; i < 800; i += (surface->w * 3))
{
for(int j = 0; j < 600; j += (surface->h*3) )
{
x = rand() % 800;
y = rand() % 600;
SetPos(surface,x ,y );
}
}
}
Wszystko jest ok, mam pętle
while(exit == false)
{
while(SDL_PollEvent(&event))
{
if(event.type == SDL_QUIT)
exit = true;
}
snow(snieg); // snieg to SDL_Surface *snieg;
// dalsze działania mojego programu
}
Jak zrobić teraz, aby ten snieg "opadał " ? Bo aktualnie wyświetla go jak chce, ale stoi w miejscu : o