| |
| Author |
Message |
< x-code ~ XCode 3.0 ( Leopard ) |
|
d3
|
Posted: Fri Nov 09, 2007 3:08 pm |
|
|
| Joined: Fri Nov 09, 2007 2:56 pmPosts: 1 |
i just checked out the new 0.03 release. when i try to compile it i get an error 'ofGraphics.cpp'. after some fiddling around i found out that it seems to be not necessary to write the extra code for OS X in the 'gluTessCallback' section. by removing the '#ifdef' stuff and the OS X specific code block, i got it running again.
change
Code: #if defined( TARGET_WIN32) || defined( TARGET_LINUX ) gluTessCallback( tobj, GLU_TESS_BEGIN, (void(CALLBACK*)())&glBegin); gluTessCallback( tobj, GLU_TESS_VERTEX, (void(CALLBACK*)())&tessVertex); gluTessCallback( tobj, GLU_TESS_COMBINE, (void(CALLBACK*)())&tessCombine); gluTessCallback( tobj, GLU_TESS_END, (void(CALLBACK*)())&glEnd); gluTessCallback( tobj, GLU_TESS_ERROR, (void(CALLBACK*)())&tessError); #else // xcode / osx complained, so we write it the way that makes it happy: gluTessCallback( tobj, GLU_TESS_BEGIN, (void(CALLBACK*)(...))&glBegin); gluTessCallback( tobj, GLU_TESS_VERTEX, (void(CALLBACK*)(...))&tessVertex); gluTessCallback( tobj, GLU_TESS_COMBINE, (void(CALLBACK*)(...))&tessCombine); gluTessCallback( tobj, GLU_TESS_END, (void(CALLBACK*)(...))&glEnd); gluTessCallback( tobj, GLU_TESS_ERROR, (void(CALLBACK*)(...))&tessError); #endif
to Code: gluTessCallback( tobj, GLU_TESS_BEGIN, (void(CALLBACK*)())&glBegin); gluTessCallback( tobj, GLU_TESS_VERTEX, (void(CALLBACK*)())&tessVertex); gluTessCallback( tobj, GLU_TESS_COMBINE, (void(CALLBACK*)())&tessCombine); gluTessCallback( tobj, GLU_TESS_END, (void(CALLBACK*)())&glEnd); gluTessCallback( tobj, GLU_TESS_ERROR, (void(CALLBACK*)())&tessError);
[/code]
|
|
Top
|
|
|
theo
|
Posted: Fri Nov 09, 2007 3:53 pm |
|
|
| Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam |
Yeah there is an issue with OS X (fixed in 10.5 I imagine ) where it doesn't like that there is no indication of the arguments for a callback.
In 10.4 if you don't put the (...) in:
(void(CALLBACK*)(...))&glBegin
Then you get an error because the types don't match.
invalid conversion from 'void (*)()' to 'GLvoid (*)(...)'
The ... stands for 'arguments not specified' and I think is technically the correct but kind of anal response.
-- old post
Hey - good catch!
Strange, now that I try it it works fine for me too (Xcode 2.4.1 Tiger) - but I remember it not working and then learning all about the "..." stuff.
Thanks for finding that - it is certainly nicer to look out without the #ifdef stuff.
Does everything else compile nicely in Leopard?
I was expecting there to be quite a few Xcode 3.0, OS X 10.5 issues.
Last edited by theo on Sat Nov 10, 2007 2:51 pm, edited 1 time in total.
|
|
Top
|
|
|
theo
|
Posted: Fri Nov 09, 2007 4:03 pm |
|
|
| Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam |
Whoops, spoke too soon.
I'll see if I can get it working without making two separate versions otherwise I'll need to add some #ifdef XCODE 3.0 stuff!
Here is some cool code to figure out what version of OS X someone is running though.
Code: SInt32 system_version; if ( Gestalt(gestaltSystemVersion, &system_version) != noErr ) { system_version = 0; printf("Error getting OS X System Version\n"); } SInt32 major_version = (system_version & 0xFF00) >> 8; SInt32 minor_version = (system_version & 0x00F0) >> 4; SInt32 point_version = (system_version & 0x000F);
// Print as string: printf("Mac OS X %x.%d.%d ", major_version, minor_version, point_version);
|
|
Top
|
|
|
theo
|
Posted: Sat Nov 10, 2007 2:44 pm |
|
|
| Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam |
Okay I think I have it.
Would you mind testing some code for me?
I found some interesting stuff in
/usr/include/AvailabilityMacros.h
Which should let me detect OS X 10.5
Would you mind replacing the code you modified in ofGraphics.cpp with the code bellow and see if it compiles for you.
Code: #if defined( TARGET_WIN32) || defined( TARGET_LINUX ) || defined( MAC_OS_X_VERSION_10_5 ) gluTessCallback( tobj, GLU_TESS_BEGIN, (void(CALLBACK*)())&glBegin); gluTessCallback( tobj, GLU_TESS_VERTEX, (void(CALLBACK*)())&tessVertex); gluTessCallback( tobj, GLU_TESS_COMBINE, (void(CALLBACK*)())&tessCombine); gluTessCallback( tobj, GLU_TESS_END, (void(CALLBACK*)())&glEnd); gluTessCallback( tobj, GLU_TESS_ERROR, (void(CALLBACK*)())&tessError); #else // xcode / osx complained, so we write it the way that makes it happy: gluTessCallback( tobj, GLU_TESS_BEGIN, (void(CALLBACK*)(...))&glBegin); gluTessCallback( tobj, GLU_TESS_VERTEX, (void(CALLBACK*)(...))&tessVertex); gluTessCallback( tobj, GLU_TESS_COMBINE, (void(CALLBACK*)(...))&tessCombine); gluTessCallback( tobj, GLU_TESS_END, (void(CALLBACK*)(...))&glEnd); gluTessCallback( tobj, GLU_TESS_ERROR, (void(CALLBACK*)(...))&tessError); #endif
Thanks!
Theo
|
|
Top
|
|
|
theo
|
Posted: Fri Nov 30, 2007 8:19 am |
|
|
| Site AdminJoined: Thu Mar 01, 2007 10:03 pmPosts: 916Location: Amsterdam |
Hmm it now looks like it is more to do with the GCC version installed.
It also doesn't like the callback code on 10.4.10 which I think is when apple switched to GCC 4.3.
Looking for a solution but if you are getting errors in this point and you are on 10.4.10 just make sure you use the 10.5 way (first block of code) and not the 10.4 way.
|
|
Top
|
|
|
|
All times are UTC
Users browsing this forum: No registered users and 0 guests
|
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 post attachments in this forum
|
|
|