ATI Truform code

ObjectCreator
Unregistered
 
Post: #1
Anyone know where to find an ATI Truform example for mac?Sad Please help me!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
The code should work precisely the same on the Mac as on the PC. Is there some reason you can't find a PC example and use that?

It looks like the extension is supported under MacOSX 10.1, though I don't actually have a Radeon 8500 to verify:

(from /System/Library/Frameworks/OpenGL.framework/Headers/glext.h)
Code:
#define GL_ATIX_pn_triangles                1
Quote this message in a reply
ObjectCreator
Unregistered
 
Post: #3
It doesn't work...
I've included OpenGL Framework...

#include <OpenGL/OpenGL.h>

...Declared the tassellation level int...

int gPNTrianglesLevel;

...and write the ATI code in InitGL...

glEnable(GL_PN_TRIANGLES_ATI);
glPNTrianglesiATI( GL_PN_TRIANGLES_POINT_MODE_ATI, GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI);
gPNTrianglesLevel=5;
glPNTrianglesiATI( GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI, gPNTrianglesLevel);

...and Project Builder say:

'GL_PN_TRIANGLES_ATI' undeclared (first use of this function)
'GL_PN_TRIANGLES_POINT_MODE_ATI' undeclared (first use of this function)
'GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI' undeclared (first use of this function)
'GL_PN_TRIANGLES_TESSELLATION_LEVEL_ATI' undeclared (first use of this function)

I don't know how to do... Thanks a lot!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
You need to include <OpenGL/glext.h>
Quote this message in a reply
ObjectCreator
Unregistered
 
Post: #5
I have tried it... it doesn't work. The same error.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #6
Yeah you don't have the ext library included, how is it supposed to know how to use those ()'s unless you code them yourself? =)
Quote this message in a reply
ObjectCreator
Unregistered
 
Post: #7
I have some ATI libraries for PC. But they don't work. Where I can find the mac versions? Thanks.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #8
You will have to search around ATI's web site, I think they have a page just for developers of ATI cards? Can't remember the address but thought I seen something on it before? HTH
Quote this message in a reply
ObjectCreator
Unregistered
 
Post: #9
There are some mac examples but maybe the link is wrong because it download the PC version... The link is http://www.ati.com/developer/macos.html.
Quote this message in a reply
ObjectCreator
Unregistered
 
Post: #10
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #11
The Mac glext.h declares the extension as GL_ATIX_pn_triangles, so all the symbols end with ATIX rather than ATI. Changing the code you posted earlier by replacing ATI with ATIX everywhere allowed it to compile.

If this is different from the PC version and you want the same code to work, you could always declare the functions and constants yourself:

Code:
#if defined(GL_ATIX_pn_triangles) && GL_ATIX_pn_triangles
    #define GL_ATI_pn_triangles 1

    #define GL_PN_TRIANGLES_ATI                            0x6090
    #define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI      0x6091
    #define GL_PN_TRIANGLES_POINT_MODE_ATI                 0x6092
    #define GL_PN_TRIANGLES_NORMAL_MODE_ATI                0x6093
    #define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI          0x6094
    #define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI          0x6095
    #define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI           0x6096
    #define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI         0x6097
    #define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI      0x6098

    #define glPNTrianglesiATI(pname, param) glPNTrianglesiATIX(pname, param)
    #define glPNTrianglesfATI(pname, param) glPNTrianglesfATIX(pname, param)
#endif
Quote this message in a reply
ObjectCreator
Unregistered
 
Post: #12
Oh great!!! That's work! Thanks a lot. I've writed your name in the credits.
Quote this message in a reply
Post Reply