clear Subroutine

public subroutine clear(indx)

NAME

clear(3f) - [M_pixel] clear background to current color or specified
            color index
(LICENSE:PD)

SYNOPSIS

definition:

subroutine clear(indx)
integer,intent(in),optional :: indx

DESCRIPTION

Clears the screen to the current color or to color specified

OPTIONS

INDX   color index to set pixel array to. Optional

EXAMPLE

Sample program

program demo_clear
use :: M_pixel
use :: M_writegif, only : writegif
implicit none
real,parameter :: x=400.0, y=400.0
   call prefsize(int(x), int(y)) ! set up drawing surface
   call vinit()
   call color(1)
   call linewidth(300)
   ! clear a circle and rectangle in default window and viewport
   call rect(0.0,0.0,x,y)
   call circle(x/2.0,y/2.0,x/2.0)
   ! now clear screen to current color
   call color(3)
   call clear()
   ! gif should be blank
   call writegif('clear.3m_pixel.gif',P_pixel,P_colormap)
   call execute_command_line('display clear.3m_pixel.gif')
   call vexit()
end program demo_clear

AUTHOR

John S. Urban

LICENSE

Public Domain

Arguments

Type IntentOptional Attributes Name
integer, intent(in), optional :: indx

Contents

Source Code


Source Code

subroutine clear(indx)

! ident_10="@(#) M_pixel clear(3f) set background color all to specified color index"

integer,intent(in),optional :: indx
call if_init()
if(present(indx))then
   P_pixel=indx
else
   P_pixel=P_COLOR_INDEX
endif
end subroutine clear