- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I am trying to use fglrendermode option. The Opengl book says its a function and the help library says its a function, but the compiler wants it declared as a subroutine. As a function it is supposed to return the number of mouse hits. I am confused as to how this option is to be used. Can someone help me?
Thanks
Kausik
I am trying to use fglrendermode option. The Opengl book says its a function and the help library says its a function, but the compiler wants it declared as a subroutine. As a function it is supposed to return the number of mouse hits. I am confused as to how this option is to be used. Can someone help me?
Thanks
Kausik
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
fglrendermode is indeed a function but the interface in module Dfopngl is not correct.
I solved it by making a separate module with a function ownfglrendermode in which the interface is stated in the right way.
It looks as follows:
I hope this will help you.
Guus Nijhuis
I solved it by making a separate module with a function ownfglrendermode in which the interface is stated in the right way.
It looks as follows:
integer*4 function ownfglRenderMode (mode ) !DEC$IF DEFINED(_X86_) !DEC$ ATTRIBUTES STDCALL, ALIAS : '_glRenderMode@4' :: fglRenderMode !DEC$ELSE !DEC$ ATTRIBUTES STDCALL, ALIAS : 'glRenderMode' :: fglRenderMode !DEC$ENDIF integer*4 mode ownfglRenderMode = fglRenderMode(mode) end function ownfglRenderMode
I hope this will help you.
Guus Nijhuis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the mess in the first line of the example in the prior message.
Every "!" should start a new line, but I don't know how to get it right.
Guus
Every "!" should start a new line, but I don't know how to get it right.
Guus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll fix it - the best way to show code is to bracket it in
... .
I agree that the declaration in DFOPNGL is wrong. We'll fix DFOPNGL in a future update.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I pasted your fix into dfopngl.f90 and then ran my project by invoking
hits=ownfglrendermode(GL_RENDER)
(where hits is an integer)
But I still get the linker error. Am I missing something?
Thanks
Kausik
I pasted your fix into dfopngl.f90 and then ran my project by invoking
hits=ownfglrendermode(GL_RENDER)
(where hits is an integer)
But I still get the linker error. Am I missing something?
Thanks
Kausik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the linker error?
If you are not also using DFOPNGL, you'll want to add opengl32.lib, glaux.lib and glu32.lib to the list of libraries you link against.
Steve
If you are not also using DFOPNGL, you'll want to add opengl32.lib, glaux.lib and glu32.lib to the list of libraries you link against.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I pasted the fix in Dfopngl.f90 just beneath the interface for "fglrendermode" and I ran my project by invoking "ownfglrendermode". But I get the following linker error:
Linking...
xtalmouse.obj : error LNK2001: unresolved external symbol _OWNFGLRENDERMODE@4
Debug/xtaldraw_w.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Should I make any changes to "dfopngl.mod" or any others in addition to modifying dfopngl.f90?
Thanks
Kausik
I pasted the fix in Dfopngl.f90 just beneath the interface for "fglrendermode" and I ran my project by invoking "ownfglrendermode". But I get the following linker error:
Linking...
xtalmouse.obj : error LNK2001: unresolved external symbol _OWNFGLRENDERMODE@4
Debug/xtaldraw_w.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Should I make any changes to "dfopngl.mod" or any others in addition to modifying dfopngl.f90?
Thanks
Kausik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't paste the code in DFOPNGL.F90 - that won't do a thing for you. Put it in your own code, in the routine that calls fglRenderMode.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
When I paste the following code in my routine:
interface
integer*4 function ownfglRenderMode (mode )
!DEC$IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_glRenderMode@4' :: fglRenderMode
!DEC$ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'glRenderMode' :: fglRenderMode
!DEC$ENDIF
integer*4 mode
ownfglRenderMode = fglRenderMode(mode)
end function ownfglRenderMode
end interface
I get a compiler error :
Error: This statement is invalid in an INTERFACE block.
ownfglRenderMode = fglRenderMode(mode)
^
Can someone help me ?
Thanks
Kausik
When I paste the following code in my routine:
interface
integer*4 function ownfglRenderMode (mode )
!DEC$IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_glRenderMode@4' :: fglRenderMode
!DEC$ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'glRenderMode' :: fglRenderMode
!DEC$ENDIF
integer*4 mode
ownfglRenderMode = fglRenderMode(mode)
end function ownfglRenderMode
end interface
I get a compiler error :
Error: This statement is invalid in an INTERFACE block.
ownfglRenderMode = fglRenderMode(mode)
^
Can someone help me ?
Thanks
Kausik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, I see. I didn't look at Guus' suggestion closely enough.
Use this instead:
Steve
Use this instead:
interface integer*4 function ownfglRenderMode (mode ) !DEC$IF DEFINED(_X86_) !DEC$ ATTRIBUTES STDCALL, ALIAS : '_glRenderMode@4' :: ownfglRenderMode !DEC$ELSE !DEC$ ATTRIBUTES STDCALL, ALIAS : 'glRenderMode' :: ownfglRenderMode !DEC$ENDIF integer*4 mode end function ownfglRenderMode end interface
Steve
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page