JOGL JavaOne demos and Mac OS X port

The source code for the JOGL demos shown at JavaOne is now available on java.net. Please look for it at http://jogl-demos.dev.java.net/ . Currently most of the demos rely on NVidia hardware, but we hope some of you will have time to help us port these to more standard extensions like (for example) ARB_vertex_program; a couple of the demos have already been ported from NV_vertex_program to the ARB version.

The initial port of JOGL to Mac OS X has been completed by Gerard Ziemski and I and is now checked in. Thanks to Marc Downie for supplying the version that had been in the source base, which was a prototype that worked exclusively with the NSOpenGLView Cocoa widget. The new OS X port supports both the GLCanvas abstraction and the NSOpenGLView widget. Please see the user guide (location below) for some significant caveats on the OS X support at the moment; however, the NVidia demos that don’t require pbuffers are working and look good.

Please see the new documentation in doc/userguide in the jogl source tree and in doc/readme.html in the jogl-demos source tree for instructions on building and platform notes. The documentation was a little rushed so please suggest and/or make improvements.

Note for Windows users: if you encounter problems running the demos (for example, some of the cubemaps or textures fail to load) make sure you have done a cvs update -kb of jogl-demos/src/demos/data. All of the binary files in the workspace are in that subdirectory, and I routinely see cvs attempt to do CR/LF translation on these files even after checking out this directory with the -kb option. If you have any suggestions for fixing this problem more permanenty please let me know.

-Ken

Did you remember to add the files with the -kb flag? I add binaryfiles to cvs like this, and I have no problems on linux and win32:

cvs add -kb

  • elias

An easier way to do this is set up the cvswrappers file to automatically recognise which are binary files. It doesn’t look like the CVS is properly set up for that yet.

The files were originally added with -kb and in fact on at least one Windows box they get checked out properly all the time. However I’ve seen at least two other boxes where they don’t and haven’t tracked down the difference yet. I suspect it might be whether Cygwin was originally installed using the Unix vs. DOS format for text files.

Thanks for the suggestions so far.

-Ken

I’m not sure what I’m doing wrong, but it failed to build on Mac OS X for me…

[tons of msgs etc… follwed by:]
Note: …/src/net/java/games/gluegen/GlueGen.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
javac -source 1.4 -d …/build/classes …/src/net/java/games/gluegen/opengl/BuildStaticGLInfo.java
java -cp “…/build/classes:” net.java.games.gluegen.GlueGen -Enet.java.games.gluegen.opengl.GLEmitter -Cgl-macosx.cfg -Istub_includes/macosx -Istub_includes/x11 -Istub_includes/win32 -Istub_includes/opengl stub_includes/macosx/gl.c
CharScanner; panic: ClassNotFoundException: net.java.games.gluegen.cgram.CToken
make[1]: *** […/build/gensrc/classes/net/java/games/jogl/GL.java] Error 1
make: [macosx] Error 2 (ignored)

I made it a lot further than you did, with a build failure at:

I’m going to dig through the source and see if its something easy to patch.

There is a bug in MacOSXOnscreenGLContext.java :

nsView = macosxdsi.cocoaViewRef();

This function does not exist and I assume that it is supposed to point to the only cocoa window reference function:

nsView = macosxdsi.cocoaWindowRef();

I’ll ping Gerard, because after this it builds and links just fine. Haven’t tried to run it yet, but I’m sure I’ll have a chance to play around with it this evening. Just wanted to get it to build.

Glad to see progress being made on any front where OS X is concerned. However, are either of your still working on the LWJGL port to OS X or have you put that aside for the JOGL?

Information about precompiled binaries for OSX is available at http://www.freeroller.net/page/gregorypierce

More later (and at the blog) as I run them through their paces and get ready to dig deeper into JInput as this will be the native implementation for LWJGL through OSX.

[quote]Glad to see progress being made on any front where OS X is concerned. However, are either of your still working on the LWJGL port to OS X or have you put that aside for the JOGL?
[/quote]
I’m currently focussed on JOGL because I have a project that needs to do some things that JOGL does today (actually they needed it when I was working on LWJGL - but LWJGL is headed down a different path). Since the OpenGL binding for LWJGL is done I will get JOGL up to that same capability then move to input for both, then if I have some free time - OpenAL for Java. Right now its not high on my list because I have a JNI binding to a commercial library which is a lot better.

Stupid question time greg.

How can I get my browser to download the JNI lib? It doesnt recognize the extension and thus is currently trying to display it as HTML :frowning:

JK

right click (hope you’re on a mac :wink: - save as…? :o (edit: btw, this works on mozilla firebird with text links extensions)

/me runs for cover ;D

[quote]right click (hope you’re on a mac :wink: - save as…? :o (edit: btw, this works on mozilla firebird with text links extensions)

/me runs for cover ;D
[/quote]
Would work if they were links but they aren’t. At least not ones Safari understands. They are just text.

JK

ehh, yes - notice the edit I added after I discovered that they weren’t actually links :slight_smile:
firebird rocks ;D http://forums.mozillazine.org/viewtopic.php?t=6381

I’ll change the page - blame the freeroller tools. I forgot that I had to do - the links myself.

With Safari just right click on a link and select “Download Link to Disk”.

New OSX build is done. Same URLs as the last ones. These are compiled with the latest DP102 from Apple and using gcc3.3 for native compilation so that whenever my new G5 shows up the native library will already be optimized.

Gregory: as you’ve already found, the Mac OS X JOGL sources require the Java (specifically, the jawt.h and jawt_md.h) from the 10.3 developer preview. I had thought all of the data members of the JAWT_MacOSXDrawingSurfaceInfo would have been in earlier releases, but Gerard Ziemski did a lot of work on the JAWT to get it to work properly with JOGL.

Ok, using Greg’s build I tried to run the demos…
java demos.gears.Gears
CANVAS GL IS: net.java.games.jogl.impl.macosx.MacOSXGLImpl
CANVAS GLU IS: net.java.games.jogl.impl.GLUImpl
Bus error
:frowning:

Date/Time: 2003-06-27 10:03:23 -0400
OS Version: 10.2.6 (Build 6L60)
Host: Scott-Palmers-Computer.local.

Command: java
PID: 4470

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000020

Thread 0:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x96697a40 in __cmpdi2
#3 0x966d9584 in JVM_GetCPFieldSignatureUTF
#4 0x966fd1dc in JVM_GetMethodIxModifiers
#5 0x966fa478 in JVM_MonitorWait
#6 0x01310580 in 0x1310580
#7 0x01309fb0 in 0x1309fb0
#8 0x01309e30 in 0x1309e30
#9 0x01309fb0 in 0x1309fb0
#10 0x0130716c in 0x130716c
#11 0x966a80c8 in JVM_Read
#12 0x966ce0f4 in JVM_FillInStackTrace
#13 0x966c20d4 in JVM_GetCPFieldClassNameUTF
#14 0x966c38b0 in JVM_GetMethodIxLocalsCount
#15 0x95e67da4 in +[EventFactory drawRect:forView:usingGC:]
#16 0x95e65ec8 in -[NSViewAWT drawRect:]
#17 0x930809ec in -[NSView _drawRect:clip:]
#18 0x93096a34 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
#19 0x93096bbc in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
#20 0x93096bbc in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
#21 0x930c8180 in -[NSFrameView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#22 0x930b2c14 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#23 0x930963f4 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#24 0x930a5778 in -[NSView displayIfNeeded]
#25 0x930b5608 in -[NSWindow displayIfNeeded]
#26 0x930dc8b8 in -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:]
#27 0x95e68a08 in -[CWindow show]
#28 0x95e66978 in -[CWindow updateState]
#29 0x95e6730c in -[ControlModel syncFromJava]
#30 0x95e67a00 in -[ContainerModel syncFromJava]
#31 0x95e66bdc in -[CWindow syncFromJava]
#32 0x95e65858 in +[ThreadUtilities updateModels:]
#33 0x97e2e024 in __NSFireMainThreadPerform
#34 0x901a8fb8 in __CFRunLoopPerformPerform
#35 0x90149414 in __CFRunLoopDoSources0
#36 0x901487f8 in __CFRunLoopRun
#37 0x90180f58 in CFRunLoopRunSpecific
#38 0x969a3b70 in RunCurrentEventLoopInMode
#39 0x969b3b00 in ReceiveNextEventCommon
#40 0x969dabbc in BlockUntilNextEventMatchingListInMode
#41 0x9308dedc in _DPSNextEvent
#42 0x930a0158 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#43 0x930b1d88 in -[NSApplication run]
#44 0x95e6ccec in -[StartupUtility run]
#45 0x97e2e024 in __NSFireMainThreadPerform
#46 0x901a8fb8 in __CFRunLoopPerformPerform
#47 0x90149414 in __CFRunLoopDoSources0
#48 0x901487f8 in __CFRunLoopRun
#49 0x90180f58 in CFRunLoopRunSpecific
#50 0x000048d8 in 0x48d8
#51 0x00002380 in 0x2380
#52 0x00002200 in 0x2200

Thread 1:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x966979a4 in __cmpdi2
#3 0x966d09ec in JVM_FillInStackTrace
#4 0x967728f8 in JVM_EnableCompiler
#5 0x96772808 in JVM_EnableCompiler
#6 0x00002d2c in 0x2d2c
#7 0x000047bc in 0x47bc
#8 0x90020d48 in _pthread_body

Thread 2:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x9676cbac in JNI_CreateJavaVM_Impl
#3 0x9676cd30 in JNI_CreateJavaVM_Impl
#4 0x96765e4c in JVM_IsSupportedJNIVersion
#5 0x90020d48 in _pthread_body

Thread 3:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x96697a40 in __cmpdi2
#3 0x966d098c in JVM_FillInStackTrace
#4 0x966e20cc in JVM_RawMonitorEnter
#5 0x968620bc in JVM_UnloadLibrary
#6 0x96765e4c in JVM_IsSupportedJNIVersion
#7 0x90020d48 in _pthread_body

Thread 4:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x966979a4 in __cmpdi2
#3 0x966d9584 in JVM_GetCPFieldSignatureUTF
#4 0x966fd1dc in JVM_GetMethodIxModifiers
#5 0x966fa478 in JVM_MonitorWait
#6 0x01310580 in 0x1310580
#7 0x01309fb0 in 0x1309fb0
#8 0x01309fb0 in 0x1309fb0
#9 0x0130716c in 0x130716c
#10 0x966a80c8 in JVM_Read
#11 0x96752424 in JVM_StartThread
#12 0x96757530 in JVM_GC
#13 0x967574c4 in JVM_GC
#14 0x96745964 in JVM_GetClassInterfaces
#15 0x96765e4c in JVM_IsSupportedJNIVersion
#16 0x90020d48 in _pthread_body

Thread 5:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x966979a4 in __cmpdi2
#3 0x966d9584 in JVM_GetCPFieldSignatureUTF
#4 0x966fd1dc in JVM_GetMethodIxModifiers
#5 0x966fa478 in JVM_MonitorWait
#6 0x01310580 in 0x1310580
#7 0x01309fb0 in 0x1309fb0
#8 0x01309ec0 in 0x1309ec0
#9 0x01309ec0 in 0x1309ec0
#10 0x0130716c in 0x130716c
#11 0x966a80c8 in JVM_Read
#12 0x96752424 in JVM_StartThread
#13 0x96757530 in JVM_GC
#14 0x967574c4 in JVM_GC
#15 0x96745964 in JVM_GetClassInterfaces
#16 0x96765e4c in JVM_IsSupportedJNIVersion
#17 0x90020d48 in _pthread_body

Thread 6:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x96697a40 in __cmpdi2
#3 0x966a2624 in JVM_CurrentTimeMillis
#4 0x966a26c0 in JVM_CurrentTimeMillis
#5 0x96765e4c in JVM_IsSupportedJNIVersion
#6 0x90020d48 in _pthread_body

Thread 7:
#0 0x90034848 in semaphore_wait_trap
#1 0x9676684c in JVM_IsSupportedJNIVersion
#2 0x96766634 in JVM_IsSupportedJNIVersion
#3 0x96745964 in JVM_GetClassInterfaces
#4 0x96765e4c in JVM_IsSupportedJNIVersion
#5 0x90020d48 in _pthread_body

Thread 8:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x966979a4 in __cmpdi2
#3 0x966d09ec in JVM_FillInStackTrace
#4 0x9670c2bc in JVM_IsConstructorIx
#5 0x966ed120 in JVM_RawMonitorEnter
#6 0x96745964 in JVM_GetClassInterfaces
#7 0x96765e4c in JVM_IsSupportedJNIVersion
#8 0x90020d48 in _pthread_body

Thread 9:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x966979a4 in __cmpdi2
#3 0x966d9584 in JVM_GetCPFieldSignatureUTF
#4 0x966fd1dc in JVM_GetMethodIxModifiers
#5 0x966fa478 in JVM_MonitorWait
#6 0x01310580 in 0x1310580
#7 0x01309fb0 in 0x1309fb0
#8 0x01309fb0 in 0x1309fb0
#9 0x0130a310 in 0x130a310
#10 0x0130716c in 0x130716c
#11 0x966a80c8 in JVM_Read
#12 0x96752424 in JVM_StartThread
#13 0x96757530 in JVM_GC
#14 0x967574c4 in JVM_GC
#15 0x96745964 in JVM_GetClassInterfaces
#16 0x96765e4c in JVM_IsSupportedJNIVersion
#17 0x90020d48 in _pthread_body

Thread 10 Crashed:
#0 0x9068bc04 in objc_msgSend_stret
#1 0x05473dc8 in createContext
#2 0x0547e3a0 in Java_net_java_games_jogl_impl_macosx_CGL_createContext
#3 0x01310580 in 0x1310580
#4 0x01309f20 in 0x1309f20
#5 0x01309fb0 in 0x1309fb0
#6 0x01309e30 in 0x1309e30
#7 0x01309fb0 in 0x1309fb0
#8 0x01309fb0 in 0x1309fb0
#9 0x01309fb0 in 0x1309fb0
#10 0x01309fb0 in 0x1309fb0
#11 0x01309fb0 in 0x1309fb0
#12 0x01309fb0 in 0x1309fb0
#13 0x01309fb0 in 0x1309fb0
#14 0x0130a310 in 0x130a310
#15 0x01309fb0 in 0x1309fb0
#16 0x01309fb0 in 0x1309fb0
#17 0x01309fb0 in 0x1309fb0
#18 0x01309e30 in 0x1309e30
#19 0x01309fb0 in 0x1309fb0
#20 0x01309fb0 in 0x1309fb0
#21 0x01309fb0 in 0x1309fb0
#22 0x0130716c in 0x130716c
#23 0x966a80c8 in JVM_Read
#24 0x96752424 in JVM_StartThread
#25 0x96757530 in JVM_GC
#26 0x967574c4 in JVM_GC
#27 0x96745964 in JVM_GetClassInterfaces
#28 0x96765e4c in JVM_IsSupportedJNIVersion
#29 0x90020d48 in _pthread_body

Thread 11:
#0 0x90073c48 in mach_msg_trap
#1 0x90005f90 in mach_msg
#2 0x966979a4 in __cmpdi2
#3 0x966d9584 in JVM_GetCPFieldSignatureUTF
#4 0x966fd1dc in JVM_GetMethodIxModifiers
#5 0x966fa478 in JVM_MonitorWait
#6 0x01310580 in 0x1310580
#7 0x01309fb0 in 0x1309fb0
#8 0x01309ec0 in 0x1309ec0
#9 0x01309ec0 in 0x1309ec0
#10 0x0130a310 in 0x130a310
#11 0x0130716c in 0x130716c
#12 0x966a80c8 in JVM_Read
#13 0x96752424 in JVM_StartThread
#14 0x96757530 in JVM_GC
#15 0x967574c4 in JVM_GC
#16 0x96745964 in JVM_GetClassInterfaces
#17 0x96765e4c in JVM_IsSupportedJNIVersion
#18 0x90020d48 in _pthread_body

Thread 12:
#0 0x966b7aac in JVM_GetCPMethodSignatureUTF
#1 0x0137d480 in 0x137d480
#2 0x013a1ecc in 0x13a1ecc
#3 0x013a3648 in 0x13a3648
#4 0x013a4260 in 0x13a4260
#5 0x013a483c in 0x13a483c
#6 0x0137e680 in 0x137e680
#7 0x0130a310 in 0x130a310
#8 0x0130716c in 0x130716c
#9 0x966a80c8 in JVM_Read
#10 0x96752424 in JVM_StartThread
#11 0x96757530 in JVM_GC
#12 0x967574c4 in JVM_GC
#13 0x96745964 in JVM_GetClassInterfaces
#14 0x96765e4c in JVM_IsSupportedJNIVersion
#15 0x90020d48 in _pthread_body

PPC Thread State:
srr0: 0x9068bc04 srr1: 0x0200f030 vrsave: 0x00000000
xer: 0x00000000 lr: 0x05473dc8 ctr: 0x9068bbf0 mq: 0x00000000
r0: 0x05473dc8 r1: 0xf0538fc0 r2: 0x00000085 r3: 0xf0539040
r4: 0x00010001 r5: 0x906b6178 r6: 0x00000000 r7: 0x00000000
r8: 0x0000000d r9: 0x00000008 r10: 0xa6692c48 r11: 0x906faf48
r12: 0x00000000 r13: 0x000abed0 r14: 0x000bf6b0 r15: 0x0547e38c
r16: 0xf0539110 r17: 0x6b13b4e0 r18: 0xf0539160 r19: 0xf05390f8
r20: 0x6b13b828 r21: 0x6b13b4dc r22: 0x000000b8 r23: 0x0130f1e0
r24: 0x0000000a r25: 0xf0539bb0 r26: 0xf0539b70 r27: 0x000abed0
r28: 0xf0539000 r29: 0xa6692c98 r30: 0x00010001 r31: 0x05473d88


Unless you’re running the Developer Preview for Panther - its not going to run for you.