forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error during compilation with OpenGL glRenderMode

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
cluosh



Joined: 15 Mar 2013
Posts: 20

PostPosted: Sat Nov 02, 2013 7:32 pm    Post subject: Error during compilation with OpenGL glRenderMode Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sat Nov 02, 2013 9:20 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
cluosh



Joined: 15 Mar 2013
Posts: 20

PostPosted: Sun Nov 03, 2013 2:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
cluosh



Joined: 15 Mar 2013
Posts: 20

PostPosted: Sun Nov 03, 2013 2:52 pm    Post subject: Reply with quote

Found my error, if glRenderMode is called like a subroutine before, FTN95 refuses to see it as a function.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group