gluttimerfunc / fortran / recursive subroutine

Hi,

I’m using the gluttimerfunc to update my graph and I have some problems using it in a recursive subroutine.

PROGRAM MAIN

USE timer_update

CALL gluttimerfunc(2000_glcuint,timer,0_glcint)

END PROGRAM MAIN

MODULE timer_update
IMPLICIT NONE
CONTAINS
RECURSIVE SUBROUTINE timer(selection)
USE opengl_gl
USE opengl_glut
INTEGER(glcint), INTENT(IN OUT) :: selection
CALL update_graph ! Subroutine for updating …
CALL gluttimerfunc(2000_glcuint,timer,0_glcint)
END SUBROUTINE timer
END MODULE timer_update

When the timer is called in the subroutine, the program just crashes !

Is someone have an idea on that ?

Thanks !

PODallaire

what was your OpenGL question again?

i have to admit my fortran is a bit rusty :wink: heck, i didnt know you could use glut with fortran … incredible!

you might try digging around in this forum:
http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=forum;f=10

i stumbled on this and thought it might be useful to someone using fortran. its from the glut win32 distribution readme-win32.txt.

FORTRAN NOTES:
Bill Mitchell has put considerable effort into getting GLUT to work with different compilers for
Fortran 90. He indicates that you should copy the f90glut.h file to your $(MSDevDir)....\VC98\include\GL directory. Then, just build GLUT as usual. The Fortran 90 interface, f90gl, can be obtained at http://math.nist.gov/f90gl and contains installation instructions and usage examples.