View previous topic :: View next topic |
Author |
Message |
callum
Joined: 16 Aug 2011 Posts: 4
|
Posted: Mon Sep 19, 2011 11:50 pm Post subject: Exception thrown when loading extensions - glGetMinMaxARB |
|
|
Hi,
I have used Derelict2 a lot on windows, just porting some code to linux now. After creating a gl context and making it current (and having loaded DerelictGL), I call
Code: |
DerelictGL.loadExtendedVersions();
DerelictGL.loadExtensions();
|
But the loadExtensions() call throws a SymbolLoadException for glGetMinMaxARB. I have tried to catch this exception using the Derelict_SetMissingProcCallback function, as I use this under windows (for DerelictFT), but it doesn't catch it. Two questions: should I be able to catch this exception using the callback? and should this exception be thrown in the first place (I thought loadExtensions() tried to load what it could, but marked some symbols as unloaded if it couldn't load them)?
Thanks a lot for your help and for Derelict, without it I wouldn't have started using D. |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Tue Sep 20, 2011 3:54 am Post subject: |
|
|
callum wrote: | Hi,
I have used Derelict2 a lot on windows, just porting some code to linux now. After creating a gl context and making it current (and having loaded DerelictGL), I call
Code: |
DerelictGL.loadExtendedVersions();
DerelictGL.loadExtensions();
|
But the loadExtensions() call throws a SymbolLoadException for glGetMinMaxARB. |
loadExtensions only throws exceptions on missing symbols when Derelict is compiled in debug mode. Are you compiling your app and Derelict all in one go, or are you compiling Derelict separately and linking with it? If the latter, just make sure you compile it without the debug mode flag. Actually, I should probably remove that completely. It shouldn't ever be throwing exceptions at all. I'll update SVN with that in a moment. If you update your local copy afterward, the problem will go away no matter how you compile.
But really, I'm confused. Are you sure the name of the method that's failing is glGetMinMaxARB? There shouldn't be an ARB on the end of that. glGetMinMax is a part of the GL_ARB_imaging extension, but the method names have no 'ARB' appended to them.
Quote: |
I have tried to catch this exception using the Derelict_SetMissingProcCallback function, as I use this under windows (for DerelictFT), but it doesn't catch it. |
The Selective Symbol Loading mechanism does not 'catch' exceptions. It prevents an exception from being thrown. When the loader finds that a symbol fails to load from the shared library, it calls the missing proc callback (in Derelict 2, that's an alias, btw -- the thing to use now is Derelict_SetMissingSymbolCallback). Then, based on the return value of the callback, it either throws a SymbolLoadException or ignores the failure and keeps on trucking.
Quote: | Two questions: should I be able to catch this exception using the callback? and should this exception be thrown in the first place (I thought loadExtensions() tried to load what it could, but marked some symbols as unloaded if it couldn't load them)? |
You thought correctly. As I mention above, the exception is only thrown by loadExtensions in debug mode. I must have put that in early on in Derelict 2 development and forgotten all about it. No exception should be thrown at all, and the missing symbol callback is never called, when loading extensions.
Quote: | Thanks a lot for your help and for Derelict, without it I wouldn't have started using D. |
Glad to hear it! Maybe one day, I'll get around to getting Derelict 2 wrapped up. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
callum
Joined: 16 Aug 2011 Posts: 4
|
Posted: Tue Sep 20, 2011 10:42 pm Post subject: |
|
|
Ah ok, I include the derelict files I need directly in my project, so they get compiled along with it. I'm sure I remember reading a post not long ago where you explained the thing about exceptions in debug mode, but it didn't stick.
The actual symbol that failed to load was: glGetnMinMaxARB (i missed the 'n' previously). At least in the console output it has the ARB on the end.
I hardly ever leave debug mode, so for now I have commented out the bit that does the throwing in bindExtFunc. I'm surprised I didn't see this under windows, alhtough I probably have newer drivers for that box.
Thanks for the help! |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Wed Sep 21, 2011 6:10 am Post subject: |
|
|
callum wrote: | The actual symbol that failed to load was: glGetnMinMaxARB (i missed the 'n' previously). At least in the console output it has the ARB on the end. |
Ah, OK. That's in the GL_ARB_robustness extension. Now I'm no longer confused!
Quote: |
I hardly ever leave debug mode, so for now I have commented out the bit that does the throwing in bindExtFunc. I'm surprised I didn't see this under windows, alhtough I probably have newer drivers for that box. |
I've updated SVN. The exception is no longer thrown even in debug mode. I see how that could be rather annoying when compiling everything in one go. And it really makes no sense to throw an exception there outside of testing changes. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
|
|
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
|