Skip to content

Commit d19cf96

Browse files
author
Jack Kelly
committed
refactored project name canvas->pixels
1 parent 28e0edd commit d19cf96

File tree

17 files changed

+113
-92
lines changed

17 files changed

+113
-92
lines changed

1_pixel.c renamed to examples/1_pixel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#include <unistd.h>
55
#include "SDL.h"
66

7-
#include "canvas/canvas.h"
8-
#include "canvas/screen.h"
9-
#include "canvas/draw.h"
7+
#include "pixels/canvas.h"
8+
#include "pixels/screen.h"
9+
#include "pixels/draw.h"
1010

1111

1212
int main(int argc, char *argv[])

2_line.c renamed to examples/2_line.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#include <unistd.h>
55
#include "SDL.h"
66

7-
#include "canvas/canvas.h"
8-
#include "canvas/screen.h"
9-
#include "canvas/draw.h"
7+
#include "pixels/canvas.h"
8+
#include "pixels/screen.h"
9+
#include "pixels/draw.h"
1010

1111

1212
int main(int argc, char *argv[])

3_box.c renamed to examples/3_box.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#include <unistd.h>
55
#include "SDL.h"
66

7-
#include "canvas/canvas.h"
8-
#include "canvas/screen.h"
9-
#include "canvas/draw.h"
7+
#include "pixels/canvas.h"
8+
#include "pixels/screen.h"
9+
#include "pixels/draw.h"
1010

1111

1212
int main(int argc, char *argv[])

4_splash.c renamed to examples/4_splash.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#include <unistd.h>
55
#include "SDL.h"
66

7-
#include "canvas/canvas.h"
8-
#include "canvas/screen.h"
9-
#include "canvas/draw.h"
7+
#include "pixels/canvas.h"
8+
#include "pixels/screen.h"
9+
#include "pixels/draw.h"
1010

1111

1212
int main(int argc, char *argv[])
File renamed without changes.

5_rows.c renamed to examples/5_rows.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#include <unistd.h>
55
#include "SDL.h"
66

7-
#include "canvas/canvas.h"
8-
#include "canvas/screen.h"
9-
#include "canvas/draw.h"
7+
#include "pixels/canvas.h"
8+
#include "pixels/screen.h"
9+
#include "pixels/draw.h"
1010

1111

1212
int main(int argc, char *argv[])

6_avalanche.c renamed to examples/6_avalanche.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@
55
#include <time.h>
66
#include "SDL.h"
77

8-
#include "canvas/canvas.h"
9-
#include "canvas/screen.h"
10-
#include "canvas/draw.h"
8+
#include "pixels/canvas.h"
9+
#include "pixels/screen.h"
10+
#include "pixels/draw.h"
1111

1212

1313
int main(int argc, char *argv[])
1414
{
15-
int width = 16;
16-
int height = 16;
15+
int width = 128;
16+
int height = 128;
17+
18+
int avalanche[128];
19+
int i;
20+
for (i = 0; i < 128; i++)
21+
avalanche[i] = 0;
1722

18-
int avalanche[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
1923
srand(time(NULL));
2024

2125
canvas_create(width, height);
@@ -55,7 +59,7 @@ int main(int argc, char *argv[])
5559
}
5660

5761
screen_update();
58-
usleep(41666);
62+
usleep(16777);
5963
}
6064

6165
/* ------------------------------------ */

examples/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
program: program.c
2+
gcc -Wall -o program program.c pixels/canvas.c pixels/screen.c pixels/draw.c -I/usr/include/SDL2 -D_REENTRANT -L/usr/lib/arm-linux-gnueabihf -lSDL2
3+
4+
1_pixel: 1_pixel.c
5+
gcc -Wall -o 1_pixel 1_pixel.c pixels/canvas.c pixels/screen.c pixels/draw.c -I/usr/include/SDL2 -D_REENTRANT -L/usr/lib/arm-linux-gnueabihf -lSDL2
6+
7+
2_line: 2_line.c
8+
gcc -Wall -o 2_line 2_line.c pixels/canvas.c pixels/screen.c pixels/draw.c -I/usr/include/SDL2 -D_REENTRANT -L/usr/lib/arm-linux-gnueabihf -lSDL2
9+
10+
3_box: 3_box.c
11+
gcc -Wall -o 3_box 3_box.c pixels/canvas.c pixels/screen.c pixels/draw.c -I/usr/include/SDL2 -D_REENTRANT -L/usr/lib/arm-linux-gnueabihf -lSDL2
12+
13+
4_splash: 4_splash.c
14+
gcc -Wall -o 4_splash 4_splash.c pixels/canvas.c pixels/screen.c pixels/draw.c -I/usr/include/SDL2 -D_REENTRANT -L/usr/lib/arm-linux-gnueabihf -lSDL2
15+
16+
5_rows: 5_rows.c
17+
gcc -Wall -o 5_rows 5_rows.c pixels/canvas.c pixels/screen.c pixels/draw.c -I/usr/include/SDL2 -D_REENTRANT -L/usr/lib/arm-linux-gnueabihf -lSDL2
18+
19+
6_avalanche: 6_avalanche.c
20+
gcc -Wall -o 6_avalanche 6_avalanche.c pixels/canvas.c pixels/screen.c pixels/draw.c -I/usr/include/SDL2 -D_REENTRANT -L/usr/lib/arm-linux-gnueabihf -lSDL2
21+
22+
clean:
23+
rm -f program 1_pixel 2_line 3_box 4_splash 5_rows 6_avalanche

main.c

Lines changed: 0 additions & 70 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)