From 107b7f03f28ced45d0f0271cab9f872ea022d052 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 29 Dec 2023 01:43:47 -0500 Subject: [PATCH] hgr: add bubble example --- utils/gr-sim/bubble/Makefile | 22 ++++++++++ utils/gr-sim/bubble/bubble.c | 65 ++++++++++++++++++++++++++++ utils/gr-sim/bubble/bubble_uninit.c | 66 +++++++++++++++++++++++++++++ utils/gr-sim/hgr-sim.c | 2 +- 4 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 utils/gr-sim/bubble/Makefile create mode 100644 utils/gr-sim/bubble/bubble.c create mode 100644 utils/gr-sim/bubble/bubble_uninit.c diff --git a/utils/gr-sim/bubble/Makefile b/utils/gr-sim/bubble/Makefile new file mode 100644 index 00000000..1a27db4c --- /dev/null +++ b/utils/gr-sim/bubble/Makefile @@ -0,0 +1,22 @@ +CC = gcc +CFLAGS = -Wall -O2 -I.. -g +LFLAGS = -lm + +SDL_LIBS= `sdl-config --libs` +SDL_INCLUDE= `sdl-config --cflags` +GR_SIM = ../gr-sim.a + +all: bubble + +#### + +bubble: bubble.o $(GR_SIM) + $(CC) -o bubble bubble.o $(GR_SIM) $(SDL_LIBS) $(LFLAGS) + +bubble.o: bubble.c + $(CC) $(CFLAGS) -c bubble.c + +#### + +clean: + rm -f *~ *.o bubble diff --git a/utils/gr-sim/bubble/bubble.c b/utils/gr-sim/bubble/bubble.c new file mode 100644 index 00000000..af6cc872 --- /dev/null +++ b/utils/gr-sim/bubble/bubble.c @@ -0,0 +1,65 @@ +/* Bubble */ + +#include +#include +#include +#include +#include +#include + +#include "gr-sim.h" +#include "tfv_utils.h" +#include "tfv_zp.h" + + +int main(int argc, char **argv) { + + int ch; + int n,i,j; + double r,rr,t,xx=0,u=0,v=0;//,sz,sw,sh; + + grsim_init(); + + printf("XX=%lf\n",xx); + + // HCOLOR=7 + hcolor_equals(7); + + // N=200:R=6.28/235:T=0:SZ=200:SW=280/SZ:SH=SCRH/SZ + n=32; r=6.28/235.0; + t=0; + + // HGR2:FOR I=0 TO N:RR=R*I:FOR J=0 TO N + + hgr(); + soft_switch(MIXCLR); + while(1) { + hclr(); + + clear_screens(); + for(i=0;i +#include +#include +#include +#include +#include + +#include "gr-sim.h" +#include "tfv_utils.h" +#include "tfv_zp.h" + + +int main(int argc, char **argv) { + + int ch; + int n,i,j; + double r,rr,t,xx,u=0,v=0;//,sz,sw,sh; + + grsim_init(); + + printf("XX=%lf\n",xx); + + // HCOLOR=7 + hcolor_equals(7); + + // N=200:R=6.28/235:T=0:SZ=200:SW=280/SZ:SH=SCRH/SZ + n=20; r=6.28/235.0; + t=0; + + // HGR2:FOR I=0 TO N:RR=R*I:FOR J=0 TO N + + hgr(); + soft_switch(MIXCLR); + while(1) { + hclr(); + + clear_screens(); + for(i=0;i