PDA

View Full Version : What is the fast GL flavor?



recipe for disaster
04-17-2008, 02:20 PM
I saw in another thread there are a bunch of flavors of GL for the Mac:
Cocoa
Carbon
Glut
X11 with GLX
Java with JVM

I have only been using Glut. Which of these is the fastest with textures? My application just needs to display different textures very quickly, like a movie. I don't have anything else going on in it except perhaps displaying multiple textures at the same time.

ToolTech
04-17-2008, 02:43 PM
I think that if you are an OpenGL beginner on OSX, you should try out Cocoa or Java as these are beeing promoted more or less by Apple in favour of the other variants.

My guess is that they all perform more or less equally when it comes to texture management.

If you are looking for high speed texture management, you need on a more advanced level to look at extensions that might help you. E.g to transfer pixel data from your computer memory to GPU (PixelBuffers) or using NPOT textures (textures that doesn't need to be resampled to a power of two).

Zengar
04-17-2008, 03:41 PM
OpenGL is OpenGL, the toolkits you specify are only wrappers to access OpenGL functionality; that is, they provide OS-specific support for OpenGL, like window creation and management. Of course, Java will be usually slightly slower, as it runs on a VM and has a programming paradigm overhead; also, the CNI calls are rather expensive.

arekkusu
04-18-2008, 02:45 AM
Re-stating what they said: the window system interface is about 1% of your code and has nearly no impact on the performance.

If your app's bottleneck is texture upload, then what will matter is using the proper extensions to ensure DMA upload.

Start with this old sample code (http://developer.apple.com/samplecode/TextureRange/index.html) to see how to stream textures efficiently on the Mac.

nib
04-18-2008, 09:47 AM
I'd go with cocoa.

Initially, I did not realize you can mix c++ with objective c. Which I thought was a problem because many libraries have c++ interfaces etc.

Also, Apple is deprecating Carbon from what I understand. This also relates if you want your app to be 64 bit or not. If you use Carbon you will not get 64 bit support. ( in general ) Might be some exceptions to this. I fleetingly recall cocoa using some carbon stuff but they are going to take it out in the long run.(?)

Think GLUT had some problems going to window mode from full screen under 10.4.

The OpenGL green book is really helpful.

scratt
05-17-2008, 09:49 PM
I'd go with cocoa.

Initially, I did not realize you can mix c++ with objective c. Which I thought was a problem because many libraries have c++ interfaces etc.

It's worth noting that you can mix objective c and c++ either way around.. I am currently working on a predominately c++ app, but using Cocoa modules within in. Not the most progressive way of working, but a good start for those who don't want to yet make the leap 100% for their whole application.