home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / mesa-1.2.8 / demos / fdraw.f < prev    next >
Text File  |  1996-05-27  |  2KB  |  76 lines

  1. C fdraw.f
  2.  
  3. C Fortran subroutine to test Fortran Mesa bindings.
  4. C This is called from ftest.c
  5.  
  6.  
  7.  
  8.       program fdrawf
  9.       call cmain
  10.       end
  11.  
  12.  
  13.  
  14.       subroutine fdraw( width, height )
  15.       implicit none
  16.       integer*4 width, height
  17.       real*4 mat(16)
  18.       character*256 str
  19.       integer*4 err
  20.       logical*1 n
  21.       include "../include/GL/fgl.h"
  22.  
  23. C matrix for scaling by 3.0
  24.       mat(1) = 3.0
  25.       mat(2) = 0.0
  26.       mat(3) = 0.0
  27.       mat(4) = 0.0
  28.       mat(5) = 0.0
  29.       mat(6) = 3.0
  30.       mat(7) = 0.0
  31.       mat(8) = 0.0
  32.       mat(9) = 0.0
  33.       mat(10) = 0.0
  34.       mat(11) = 3.0
  35.       mat(12) = 0.0
  36.       mat(13) = 0.0
  37.       mat(14) = 0.0
  38.       mat(15) = 0.0
  39.       mat(16) = 1.0
  40.  
  41.       str = fglGetString( GL_RENDERER )
  42.       print *, str
  43.  
  44.       err = fglGetError()
  45.       print *, "Error code", err
  46.  
  47.       n = fglIsEnabled( GL_DITHER )
  48.       print *, "dither=", n
  49.  
  50.       n = fglIsEnabled( GL_LIGHTING )
  51.       print *, "lighting=", n
  52.  
  53.       call fglViewport( 0, 0, width, height )
  54.  
  55.       call fglMatrixMode( GL_PROJECTION )
  56.       call fglLoadIdentity
  57.  
  58.       call fglMatrixMode( GL_MODELVIEW )
  59.       call fglLoadIdentity
  60.       call fglRotatef( 45.0, 0.0, 0.0, 1.0 )
  61.       call fglTranslatef( -0.6, -0.0, 0.0 )
  62.       call fglMultMatrixf( mat )
  63. C      call fglScalef( 5.0, 5.0, 0.0 )
  64.  
  65.       call fglClear( GL_COLOR_BUFFER_BIT )
  66.  
  67.       call fglBegin( GL_LINE_LOOP )
  68.       call fglVertex2i( 0, 0 )
  69.       call fglVertex2f( 0.0, 0.1 )
  70.       call fglVertex4f( 0.1, 0.1, 0.0, 1.0 )
  71.       call fglVertex3f( 0.1, 0.0, 0.0 )
  72.       call fglEnd()
  73.  
  74.       return
  75.       end
  76.