Declaration in opengl.ins is correct; this is my code:
! Includes
use gl_data
include <opengl.ins>
! Variables
integer :: buffer(512)
integer :: hits
integer :: viewport(4)
integer :: x,y
call glGetIntegerv(GL_VIEWPORT,viewport)
! Select hit buffer
call glSelectBuffer(512,buffer)
! Set render mode to select
call glRenderMode(GL_SELECT)
! Init name stack
call glInitNames()
call glPushName(0)
! Set up viewing volume
call glMatrixMode(GL_PROJECTION)
call glPushMatrix()
call glLoadIdentity
write (*,*) dble(x),dble(glHeight-y),viewport
call gluPerspective(30.0d0,glRatio,1d0,15d0)
call gluPickMatrix(dble(x),dble(glHeight-y),1.0d0,1.0d0,viewport)
! Draw
call glMatrixMode(GL_MODELVIEW)
call glLoadIdentity()
call openglTransformations(GL_SELECT)
call openglDraw3D(.true.,GL_SELECT)
! Rebuild old matrix
call glMatrixMode(GL_PROJECTION)
call glPopMatrix()
call glFlush()
! Process hits
hits = glRenderMode(GL_RENDER)
FTN95 still tells me, that glRenderMode is a subroutine.