the genp module can now run the renderer

This commit is contained in:
Tonton Th
2026-05-07 22:30:30 +02:00
parent 95a8502d0f
commit a079f026f7
4 changed files with 51 additions and 1 deletions

1
.gitignore vendored
View File

@@ -12,4 +12,5 @@ randomwalk
oscilloscope
lissajous
squarmania
testbed

View File

@@ -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

View File

@@ -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

10
testbed.f90 Normal file
View File

@@ -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