regler chargement et erreur ligne et camera pas la segfault
This commit is contained in:
@@ -41,17 +41,23 @@ static void render_pixel(t_app *app, int x, int y)
|
|||||||
|
|
||||||
void render_scene(t_app *app)
|
void render_scene(t_app *app)
|
||||||
{
|
{
|
||||||
int y;
|
const int total_pixels = app->win_height * app->win_width;
|
||||||
int x;
|
int y;
|
||||||
|
int x;
|
||||||
|
int progress;
|
||||||
|
|
||||||
|
|
||||||
y = 0;
|
y = 0;
|
||||||
|
progress = 0;
|
||||||
while (y < app->win_height)
|
while (y < app->win_height)
|
||||||
{
|
{
|
||||||
x = 0;
|
x = 0;
|
||||||
while (x < app->win_width)
|
while (x < app->win_width)
|
||||||
{
|
{
|
||||||
|
progress = ((y * app->win_width + x + 1) * 100) / total_pixels;
|
||||||
render_pixel(app, x, y);
|
render_pixel(app, x, y);
|
||||||
x++;
|
x++;
|
||||||
|
printf("\rChargement de l'écran : %d%%", progress);
|
||||||
}
|
}
|
||||||
y++;
|
y++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user