diff --git a/.gitignore b/.gitignore index 683ab7a..16a1001 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ randomwalk oscilloscope lissajous squarmania +testbed diff --git a/Makefile b/Makefile index 1b36380..b558f66 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,15 @@ +# -all: spirale.png +all: testbed # ----------------------------------------------- genplotting.o: genplotting.f90 Makefile gfortran -Wall -c $< +testbed: testbed.f90 Makefile genplotting.o + gfortran -Wall $< genplotting.o -o $@ + # ----------------------------------------------- starfield: starfield.f90 Makefile genplotting.o diff --git a/genplotting.f90 b/genplotting.f90 index cc326c4..c281d92 100644 --- a/genplotting.f90 +++ b/genplotting.f90 @@ -115,6 +115,41 @@ subroutine genp_end (foo) end subroutine ! --------------------------------------------------------- +! /!\ warning /!\ +! this procedure is highly experimental, don't use it +! for any real (or critical) work, but it was fine for +! playing around with the #UselessGraphic concept. + +subroutine genp_do_render(srcfile, tgafile, xsize, ysize) + character (len=*), intent(in) :: srcfile, tgafile + integer, intent(in) :: xsize, ysize + + character (len=1664) :: cmdline + character (len=20) :: dima, dimb + integer :: i, j, errcode + + write(0, '("--- genp do_render ---")') + write(0, '(" srcfile: ", A)') srcfile + write(0, '(" tgafile: ", A)') tgafile + write(0, '(" picsize: ", 2I5)') xsize, ysize + + write(dima, '(I5, "x", I5)') xsize, ysize + ! write(0, '("dima [",A, "]")') dima + dimb = "" ; j = 1 + do i=1, len(dima) + if (dima(i:i) .NE. ' ') then + dimb(j:j) = dima(i:i) + j = j +1 + endif + enddo + ! write(0, '("[",A, "]")') trim(dimb) + write(cmdline, '("genplot2 -s ", A, " ", A, " ", A)') & + trim(dimb), srcfile, tgafile + write(0, '(A)') trim(cmdline) + call execute_command_line(cmdline, exitstat=errcode) + write(0, '("errcode was :", I6)') errcode + +end subroutine ! --------------------------------------------------------- end module genplotting diff --git a/testbed.f90 b/testbed.f90 new file mode 100644 index 0000000..f326bab --- /dev/null +++ b/testbed.f90 @@ -0,0 +1,10 @@ +program testbed + use genplotting + implicit none + + call genp_init(0, "foo.scratch") + call plot_axes(13.37) + call genp_end(0) + call genp_do_render("foo.scratch", "foo.tga", 512, 512) + +end program