gr-sim: add text test

This commit is contained in:
Vince Weaver 2017-05-04 14:34:57 -04:00
parent 339a08444a
commit d87eac3693
2 changed files with 42 additions and 2 deletions

View File

@ -5,7 +5,11 @@ LFLAGS =
SDL_LIBS= `sdl-config --libs` SDL_LIBS= `sdl-config --libs`
SDL_INCLUDE= `sdl-config --cflags` SDL_INCLUDE= `sdl-config --cflags`
all: rainbow sparkle kaleido tfv all: rainbow sparkle kaleido tfv text
####
rainbow: rainbow.o gr-sim.o rainbow: rainbow.o gr-sim.o
$(CC) $(LFLAGS) $(SDL_LIBS) -o rainbow rainbow.o gr-sim.o $(CC) $(LFLAGS) $(SDL_LIBS) -o rainbow rainbow.o gr-sim.o
@ -15,6 +19,15 @@ rainbow.o: rainbow.c
#### ####
text: text.o gr-sim.o
$(CC) $(LFLAGS) $(SDL_LIBS) -o text text.o gr-sim.o
text.o: text.c
$(CC) $(CFLAGS) -c text.c
####
tfv: tfv.o gr-sim.o tfv: tfv.o gr-sim.o
$(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o gr-sim.o $(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o gr-sim.o
@ -42,6 +55,6 @@ gr-sim.o: gr-sim.c
$(CC) $(CFLAGS) $(SDL_INCLUDE) -c gr-sim.c $(CC) $(CFLAGS) $(SDL_INCLUDE) -c gr-sim.c
clean: clean:
rm -f *~ *.o gr-sim rainbow sparkle kaleido tfv rm -f *~ *.o gr-sim rainbow sparkle kaleido tfv text

27
gr-sim/text.c Normal file
View File

@ -0,0 +1,27 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "gr-sim.h"
int main(int argc, char **argv) {
int x,y,ch;
grsim_init();
home();
while(1) {
grsim_update();
ch=grsim_input();
if (ch=='q') break;
usleep(100000);
}
return 0;
}