View previous topic :: View next topic |
Author |
Message |
cluosh
Joined: 15 Mar 2013 Posts: 20
|
Posted: Sat Nov 02, 2013 7:32 pm Post subject: Error during compilation with OpenGL glRenderMode |
|
|
Good evening,
For selecting objects in OpenGL I need to get the return value of glRenderMode, which doesn't seem to be possible with FTN95. The compiler tells me that glRenderMode is a subroutine, when it's supposed to be a function. Any Ideas how to get the return value of glRenderMode? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Sat Nov 02, 2013 9:20 pm Post subject: |
|
|
Code: | STDCALL GLRENDERMODE 'glRenderMode' (VAL):INTEGER*4
|
is in opengl.ins.
Either the declaration is missing from your code or it is incorrect. |
|
Back to top |
|
|
cluosh
Joined: 15 Mar 2013 Posts: 20
|
Posted: Sun Nov 03, 2013 2:49 pm Post subject: |
|
|
Declaration in opengl.ins is correct; this is my code:
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. |
|
Back to top |
|
|
cluosh
Joined: 15 Mar 2013 Posts: 20
|
Posted: Sun Nov 03, 2013 2:52 pm Post subject: |
|
|
Found my error, if glRenderMode is called like a subroutine before, FTN95 refuses to see it as a function. |
|
Back to top |
|
|
|