Say it ain't so..(C++ vs. Obj. C)


Okay I am at a loss...

I programmed a little Particle system using C++ on the Iris platform and it ran fine. I got my new G4 with OsX and I noticed in the DEv tools there was a GLUT example in C(objective C I think) of a prticle system. I ran it and it kicked butt, running more than 5000 particles pretty smoothly. Very cool I thought out loud. Soooo I compiled my particle system with the IDE and ran it and this is where it all got weird...It ran slower than the old unix box and was unable to calculate collisions fast enough. I was only able to get about 100 particles running. This doesn't make any sense. I can't believe that this is a C++ thing.. I have read that OsX likes objective C but come on... Someone straighten me out. Can I not code in C++ on the OsX platform? And if I do am I always going to experience such a performance hit? Please say it ain't so...
PS I am using stdlib containers to manage my particle objects.

Any help advice would be greatly appreciated..
Where is the GLUT example? Is the example using alti-vec at all for the calculations?


If you look in the Developer/Examples/GLUTexamples/particle/ folder you will find the code I am speaking of... In any event I shouldn't be having such awful resluts with my dinky liottle particle system especially since I am running it on a G4 733 with 1.1GB RAM ...I mean the machines we have at the lab pale in comparison...

Hi jmmistrot & jdog,

Took a look at the particle.c file in the PB example. Noticed that it makes extensive use of the graphics library. I also found port.h in the GLUT.framework which appears to be a port for tubbing toolkit to the Open GL definitions. I suppose it's no surprise this example project should take advantage of native graphic frameworks as Open GL and hence perform well in those respects.

Perhaps your particle system will need to be "tuned" to take advantage of what this platform has to offer in the ways of increasing efficiency with your program.