home *** CD-ROM | disk | FTP | other *** search
/ gondwana.ecr.mu.oz.au/pub/ / Graphics.tar / Graphics / VOGLE.ZIP / VOGLE / EXAMPLES / FSIMPLE.FOR < prev    next >
Text File  |  2000-02-11  |  1KB  |  80 lines

  1. c  A program showing basic line drawing, text and (if applicable)
  2. c  colour. As none of the projection routines have been called we
  3. c  move and draw in the initial coordinate system -1.0 to 1.0.
  4. c
  5.     program fsimple
  6.     integer BLACK, GREEN
  7.     parameter (BLACK = 0, GREEN = 2)
  8.     character device*50, fname*80, p*11
  9.     data p/'Hello world'/
  10.  
  11.     print*,'Enter output device:'
  12.     read(*,'(a)') device
  13.  
  14.     print*,'Enter a font name:'
  15.     read(*,'(a)') fname
  16. c
  17. c  set up device 
  18. c
  19.     call vinit(device)
  20. c
  21. c  change font to the argument 
  22. c
  23.     call font(fname)
  24. c
  25. c  set current color
  26. c
  27.     call color(BLACK)
  28. c
  29. c  clear screen to current color 
  30. c
  31.     call clear
  32. c
  33. c
  34.     call color(GREEN)
  35. c
  36. c  2 d move to start where we want drawstr to start 
  37. c
  38.     call move2(-0.9, 0.9)
  39. c
  40. c  draw string in current color 
  41. c
  42.     call drawstr('A Simple Example')
  43.  
  44. c
  45. c  the next four lines draw the x 
  46. c
  47.     call move2(0.0, 0.0)
  48.     call draw2(0.76, 0.76)
  49.     call move2(0.0, 0.76)
  50.     call draw2(0.76, 0.0)
  51.  
  52.     call move2(0.0, 0.5)
  53.     call drawstr('x done')
  54. c
  55.     call drawstr('next sentence')
  56.  
  57.     call move2(0.0, 0.1)
  58.     do 10 i = 1, 11
  59.         call drawchar(p(i:i))
  60. 10    continue
  61.  
  62. c  the next five lines draw the square
  63. c
  64.     call move2(0.0, 0.0)
  65.     call draw2(0.76, 0.0)
  66.     call draw2(0.76, 0.76)
  67.     call draw2(0.0, 0.76)
  68.     call draw2(0.0, 0.0)
  69. c
  70. c  wait for some input 
  71. c
  72.     call getkey
  73. c
  74. c  set the screen back to its original state 
  75. c
  76.     call vexit
  77.     end
  78.