Skip to content

Commit af70572

Browse files
committed
program.c writing to a file and readme pls work
1 parent 456ca22 commit af70572

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.o
22
*.a
33
*.e
4+
*wall

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $ gcc -o program program.c -lpluto # install it before or use -L<lib_folder_pat
6060

6161
4. You're done! Just run your program now!
6262

63-
Comments in the pluto.h file describe what each function/data structure does
63+
Comments in the [pluto.h](https://github.com/smart6502/plutonem/tree/main/src/pluto.h) file describe what each function/data structure does
6464

6565
<p>Perlin noise using plutonem</p>
6666
<img src="screenshots/perlin_noise.png" align="center">
@@ -71,7 +71,7 @@ Comments in the pluto.h file describe what each function/data structure does
7171
<p>Image rendered using plutonem</p>
7272
<img src="screenshots/image_viewer.png" align="center">
7373
<br>
74-
<p>A first person shooter using plutonem</p>
74+
<p>A raycaster written with plutonem</p>
7575
<img src="screenshots/fps.png" align="center">
7676

7777
#### Plutonem is tested and works on:
@@ -96,4 +96,4 @@ Comments in the pluto.h file describe what each function/data structure does
9696
```
9797
# localectl set-locale LANG=en_US.UTF-8
9898
```
99-
4. Open an issue in the issues tab, provide your terminal name, what locale it is set to `$(locale)`, your font
99+
4. Open an issue in the issues tab, provide your terminal name, what locale it is set to, and your font

examples/program.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main()
1919

2020
pluto_write_out();
2121
pluto_render();
22-
usleep(350000);
22+
usleep(500000);
2323
}
2424

2525
pluto_deinit();

examples/wall-density.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ int main()
1111
{
1212
pluto_init_window();
1313

14+
FILE *fp = fopen("wall", "w");
15+
1416
float x, y;
1517
for (x = 1; x < _pluto_canvas.cwidth / count; x += density)
1618
{
@@ -22,11 +24,10 @@ int main()
2224
pluto_set_pix(xp, yp);
2325
pluto_set_pix_colour(xp, yp, 94, 129, 172);
2426
}
25-
26-
pluto_write_out();
27-
pluto_render();
28-
usleep(45000);
2927
}
28+
pluto_write_out();
29+
fputs((char *)_pluto_canvas.buffer, fp); // Write buffer to file
30+
fclose(fp);
3031

3132
pluto_deinit();
3233
}

0 commit comments

Comments
 (0)