the genp module can now run the renderer
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,4 +12,5 @@ randomwalk
|
|||||||
oscilloscope
|
oscilloscope
|
||||||
lissajous
|
lissajous
|
||||||
squarmania
|
squarmania
|
||||||
|
testbed
|
||||||
|
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -1,11 +1,15 @@
|
|||||||
|
#
|
||||||
|
|
||||||
all: spirale.png
|
all: testbed
|
||||||
|
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
|
|
||||||
genplotting.o: genplotting.f90 Makefile
|
genplotting.o: genplotting.f90 Makefile
|
||||||
gfortran -Wall -c $<
|
gfortran -Wall -c $<
|
||||||
|
|
||||||
|
testbed: testbed.f90 Makefile genplotting.o
|
||||||
|
gfortran -Wall $< genplotting.o -o $@
|
||||||
|
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
|
|
||||||
starfield: starfield.f90 Makefile genplotting.o
|
starfield: starfield.f90 Makefile genplotting.o
|
||||||
|
|||||||
@@ -115,6 +115,41 @@ subroutine genp_end (foo)
|
|||||||
|
|
||||||
end subroutine
|
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
|
end module genplotting
|
||||||
|
|||||||
10
testbed.f90
Normal file
10
testbed.f90
Normal 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
|
||||||
Reference in New Issue
Block a user