# Java & Cocoa



## pete-o (Mar 25, 2001)

So I don't know if this has gotten much play in your forum yet, I did  a quick search which didn't turn up anything relevant.  But what's the story with the different Cocoa features available for Objective C and Java APIs.  The example that jumps to mind is OpenGL... does anyone know if they plan to bridge the gap?  Personally, I don't have any desire to learn objective C, Java would much nicer to do everything in.  (or C++)  Thanks for any info you have.

Pete


----------



## JSR COUT (Mar 26, 2001)

The bridge has already been built.  You can access cocoa apis via java.


----------



## baobao (Apr 8, 2001)

Where could I get more info on accessing OpenGL rendering from Java? Thanks.


----------



## strobe (Apr 9, 2001)

Port GL4Java to OS X (ignore the bridge comment that other guy posted)

GL4Java is basically OpenGL for Java. It uses JNI to access the host platform's native OpenGL interface.

It should be an easy port. OS X support the standard OpenGL interfaces like AGL. There is a MacOS version of GL4Java but I do not suggest porting that. OpenGL setup in Carbon is needlessly complex, better to port the windows or eunuchs version


----------



## baobao (Apr 9, 2001)

From:

I n s i d e M a c O S X

Java Development for Mac OS X

"In addition to using the standard Java calls for graphics rendering, you also have the option of rendering using OpenGL." (page 10)

http://developer.apple.com/techpubs/java/java.html

Did anybody go any further than that?

Concerning third-party ports, "Magician" is supposed to work on OS X. Don't know about GL4Java.


----------



## strobe (Apr 9, 2001)

That's if you're using the Cocoa API (at which point why use Java). 

You can create an OpenGL view for a Cocoa application. Heck, you can make an OpenGL view using Interface Builder.


----------

