Fortraneries/GrafAnim/essai.f90

49 lines
1.0 KiB
Fortran

program essai
use usegenplot
implicit none
integer :: foo, bar
integer :: nbarg
integer :: numframe = 0
character(len=256) :: arg
! write(0, *) "------------ essai graf anim ---------------"
nbarg = IARGC()
if (nbarg .GT. 0) then
call GETARG(1, arg)
! write (0, '(A40, A5)') "argument = ", arg
read (arg, *) numframe
endif
write(0, '(A20, I5)') "frame number =", numframe
call init_genplot("essai.genplot")
call do_frame(7)
call gplt_setcol(2)
bar = (numframe * 20) - 120
do foo=20, 620, 50
call gplt_line(foo, 20, bar, 460)
call gplt_line(bar, 20, foo, 460)
enddo
call end_genplot("done for today")
contains !------------------------------------------
subroutine do_frame(color)
integer, intent(in) :: color
integer :: savecol
savecol = gplt_getcol()
call gplt_setcol(color)
call gplt_rect(0, 0, 640, 480)
call gplt_setcol(savecol)
end subroutine
end program