LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: elias4444 on January 10, 2006, 19:22:59

Title: Mac-Intel Version?
Post by: elias4444 on January 10, 2006, 19:22:59
With todays Mac keynote announcing the Intel Macs, I was wondering where lwjgl stood in respect to porting to the new platform? Anyone know?
Title: Mac-Intel Version?
Post by: Matzon on January 10, 2006, 19:38:48
yes, we do plan that - somehow...
Title: Mac-Intel Version?
Post by: numberR on January 13, 2006, 08:56:55
i think Java VM has not been released for intel-based Mac OS X yet.
we'll see if this is true or not as soon as people start to receive their iMacs or MacBook pro.

i think the biggest issue is JNI stuff such as DevIL, FMOD and maybe OpenAL too.
and last time i tried, i could successfully compile DevIL as Universal Binary.

http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html
link above explains how to compile Universal Binary using standard Unix commands.
basically, we need to add some CFLAGS before executing make like following:


CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" make


thing is, if you use gcc-4.x, the resulting binary does not work on Mac OS X 10.3.x.
However, gcc-4.x is required to create binary for x86.
so the best solution is to have Universal Binary consists of PPC binary from gcc-3.3 to support Mac OS X 10.3.x or later,
and x86 binary from gcc-4.x to support intel-based Mac OS X 10.4.x.

http://wiki.mozilla.org/Mac:Intel
it seems like Firefox team is also struggling how to get that work,
and i have no idea at this moment...

anyone?
Title: Mac-Intel Version?
Post by: miu on January 14, 2006, 03:18:56
I believe Mac-Intel does have Java. Actually, Apple's Java 5 Release 2 was for the Transition Kits only, while Releases 1 and 3 were for PPC Macs.

I'm wondering whether Rosetta will handle LWJGL in the meantime and if so, what performance hit there will be.

Universal binary would be ideal packaging-wise, but even a separate MacIntel LWJGL build would be great in order to get started.
Title: Mac-Intel Version?
Post by: numberR on January 29, 2006, 20:59:28
it seems like J2SE Release 4 will be released for PPC/x86 platforms.
it's not universal binary and i don't know why.
Title: Mac-Intel Version?
Post by: miu on January 30, 2006, 18:19:25
I also noticed that the latest Dev. Preview of the Java 5 Rel. 4 ships as two separate downloads - ppc and i386.

In Apple's implementation, Java VM is probably very close to the core OS - their JRE releases require specific OS patch levels, unlike e.g. Sun's Windows JRE. So there's no Java 5 for OS 10.3, and JRE 1.5.0_06 will require OS 10.4.4...

Java 5 Rel. 4 for Mac will also make Java 5 the "preferred" version.

This thread (http://lwjgl.org/forum/viewtopic.php?t=1472) has a link explaining that Rosetta won't work with JNI.
Title: Mac-Intel Version?
Post by: elias on February 01, 2006, 07:56:10
JNI libs on intel macs have to be universal (or at least compiled for x86), as rosetta won't help you. I've comitted a fix for LWJGL that creates two native libraries, liblwjgl.jnilib (universal, gcc4) and liblwjgl-legacy.jnilib(ppc only, gcc3). The former is for Mac OS X 10.4 and up (both ppc and x86) while the latter is for 10.3 and earlier (ppc only, naturally). The LWJGL library loader tries both libraries, depending on which platform it is run.

In addition, lwjgl now tries to load the mac os x 10.4 version of openal if a regular openal.dylib can't be found. That way you don't have to supply an universal openal.dylib. This doesn't solve the fmod/devil problem though.

We don't have an intel mac to test on, but we've had reports of Tribal Trouble running on at least one intel mac.
Title: Mac-Intel Version?
Post by: miu on March 05, 2006, 20:17:39
Hello Elias (from Oddlabs)!

I recently got my new Intel based iMac and I'm trying to make LWJGL work on it. I can see that your latest Tribal Trouble demo works on MacTels, also Puppygames' new Titan Attacks works!

However, patching the latest LWJGL 0.99 release to work doesn't seem to be straightforward - replacing binaries and jars doesn't cut it for me.

Could you provide any help with this? Perhaps you could post a Universal binary build somewhere for the rest of us who don't compile entire LWJGL from the source? Will Universal Mac binaries make it to LWJGL 1.0?

I can't seem to be able to find any binaries in the TT application, there are just .svn files there - is it supposed to be like that?

Thanks a lot!
Title: Mac-Intel Version?
Post by: elias on March 06, 2006, 08:17:46
Universal binaries will definitely be included in 1.0. In the meantime, look for lwjgl.jar.svn-base and similar named native files. Don't worry about the names and directory naming, it's based on the svn working directory structure.

- elias
Title: Mac-Intel Version?
Post by: miu on March 07, 2006, 04:02:37
Thanks, Elias, for your response!

Actually, I found that what I was trying to do works, at least partly.

Simple OpenGL examples work on an Intel Mac, hurrah!

However, since those games (TT, Titan Attacks) apparently don't bundle the entire LWJGL, Space Invaders demo that I was originally trying to run fails due to some sound issues. Also DevIL doesn't seem to be included.

It's great that I can at least start testing some stuff, however for the complete MacTel LWJGL I'll have to wait for the 1.0 release...

I guess if I asked when it's coming I'd hear the "Heinz ketchup" phrase - only comes out when it's ready? ;)
Title: Mac-Intel Version?
Post by: elias on March 07, 2006, 08:11:39
I haven't touched Devil since I don't know if (and when) it is released in an universal build. Fortunately, we can ignore OpenAL issues, since from 10.4 and up it is bundled with Mac OS X. So what kind of sound issues are you having?

- elias
Title: LWJGL works on MacTel!
Post by: miu on March 08, 2006, 03:48:38
Hello again Elias,

Thanks for your prompt response. I didn't realize that DevIL was actually a 3rd party dependence. So is fmod I guess (v.4 was released for Macx86, v.3 wasn't/won't be?). I haven't used those yet so it shouldn't be a problem.

I traced my "sound issues" to resource files not being on the classpath... this exception wasn't handled nicely so it had me confused for a while. :oops:

HOWEVER, OpenGL and OpenAL ROCK now on my MacTel! That makes the Mac-Intel transition complete for me  :wink: Who cares about Photoshop and Office :lol:

Well, I'm still looking forward to 1.0!

Thanks again, LWJGL and Tribal Trouble rule!

Let me know if you need anything tested on a MacTel - they are probably not that rare anymore, but still...
Title: Re: LWJGL works on MacTel!
Post by: elias on March 08, 2006, 07:11:43
Quote from: "miu"

Thanks for your prompt response. I didn't realize that DevIL was actually a 3rd party dependence. So is fmod I guess (v.4 was released for Macx86, v.3 wasn't/won't be?). I haven't used those yet so it shouldn't be a problem.

Yes, FMOD is another dependency, I guess matzon will have to update that one to make it mactel friendly ;)

Quote from: "miu"

HOWEVER, OpenGL and OpenAL ROCK now on my MacTel! That makes the Mac-Intel transition complete for me  :wink: Who cares about Photoshop and Office :lol:

Well, I'm still looking forward to 1.0!

Thanks again, LWJGL and Tribal Trouble rule!

Let me know if you need anything tested on a MacTel - they are probably not that rare anymore, but still...

Actually, we're still waiting for the not-awfully-expensive intel mac minis to arrive in Denmark. They're bundled with some intel gfx card, and unfortunately we've got a report about TT not running on it :/

- elias
Title: Re: LWJGL works on MacTel!
Post by: Matzon on March 08, 2006, 07:33:06
Quote from: "elias"
Quote from: "miu"

Thanks for your prompt response. I didn't realize that DevIL was actually a 3rd party dependence. So is fmod I guess (v.4 was released for Macx86, v.3 wasn't/won't be?). I haven't used those yet so it shouldn't be a problem.

Yes, FMOD is another dependency, I guess matzon will have to update that one to make it mactel friendly ;)
according to this post: http://www.fmod.org/forum/viewtopic.php?t=4658 they have released an intel version. Whats needed to get the loading going ?
Title: Mac-Intel Version?
Post by: elias on March 08, 2006, 08:03:39
You don't need to do anything, but if you want to support 10.3 and 10.4 at the same time, you'll need to supply (and try to load) two versions of the library. One is the universal binary, compiled for 10.4 and later for both ppc and i386, and the other is the legacy 10.3 and earlier ppc only binary.

Take a look at the comment in MacOSXSysImplementation for further explanation and the way I've done it for the main liblwjgl.jnilib.

- elias
Title: Mac-Intel Version?
Post by: Matzon on March 08, 2006, 08:55:50
oki - I'll look into it
however, I am not aware of any intel version of devil.
devil has been in a weird state of nothingness the last 1Ã,½ year!
lots of people use it and patches are being incorporated into cvs - but no releases are being made *ponder*
Title: Mac-Intel Version?
Post by: miu on March 08, 2006, 14:05:13
Good to hear that FMOD3 made it to Intel Mac, their download page doesn't exactly advertise this...

Regarding DevIL, perhaps some of you guys familiar with Universal Mac binary compilation could have a go at it? There's source code, right?  :?

Integrated Intel graphics on the new mini was a controversial move, doesn't that make minis even more "overpriced" than iMacs?

If I find one locally, I'll try to get the OpenGL Ext. Viewer report if you want.

But it would be better for you to have a "low end" HW to test for compatibility...
Title: Mac-Intel Version?
Post by: elias on March 08, 2006, 14:07:56
It would be more helpful if you could try TT on it. The list of supported extensions and the OpenGL version won't help us much, I'm afraid.

- elias
Title: Mac-Intel Version?
Post by: miu on March 08, 2006, 14:56:09
OK, Elias!

I'll try to download a TT demo and run it if they let me do it. Or I can bring it on a CD. I can always say that I'm only buying if TT runs on it!

But what do I do if it works? :lol:

I'll keep you posted, sooner or later our local dealers will get them.

UPDATE - Mar 09: Nobody seems to have demo units at the moment, not even the Apple store. Some stores can sell you one though...

Regards, Michal
Title: have Intel IMac, will contribute build if instructed how to
Post by: tanukitzu on March 11, 2006, 02:26:48
I just got a new Intel IMac and LWJGL does not work.  The Mac Intel version of Java 1.3, 1.4, and 5 all work great, but anything JNI breaks because the native JVM doesn't load Rosetta.

I have J2SE 5.0 set as the JVM under the Java Preferences pane.  

PuppyGames.net hangs ("not responding") FireFox 1.5.0.1 but Safari runs it just fine.  Tribal Trouble gives no sign of life when run (how do I find the error log for this?).

I'd like to contribute a Universal binary from my platform but I'm not exactly sure how to go about it.  What I've learned from the Eclipse group is that anything using JNI needs to be recompiled as a Universal.

This is my first Mac but if someone wants to give me instructions I'll contribute as much as I can.
Title: Mac-Intel Version?
Post by: princec on March 11, 2006, 15:52:27
Do any of our games (Puppygames) run on your Intel Mac? Last I heard they were working just fine.

Cas :)
Title: Mac-Intel Version?
Post by: numberR on March 11, 2006, 17:26:54
Quote from: "Matzon"oki - I'll look into it
however, I am not aware of any intel version of devil.
devil has been in a weird state of nothingness the last 1Ã,½ year!
lots of people use it and patches are being incorporated into cvs - but no releases are being made *ponder*

last time i checked,
i could compile devil as universal binary using CFLAGS thing just fine.
but you know... it's devil in many ways...
Title: Intel IMac Tribal Trouble fails to start - stack trace
Post by: tanukitzu on March 11, 2006, 17:42:07
Quote from: "princec"Do any of our games (Puppygames) run on your Intel Mac? Last I heard they were working just fine.

Cas :)

TribalTrouble fails to start with this stack trace:

Exception in thread "AWT-EventQueue-1" java.lang.IllegalArgumentException: null source
   at java.util.EventObject.<init>(EventObject.java:38)
   at java.awt.AWTEvent.<init>(AWTEvent.java:255)
   at java.awt.event.ComponentEvent.<init>(ComponentEvent.java:97)
   at java.awt.event.WindowEvent.<init>(WindowEvent.java:179)
   at java.awt.event.WindowEvent.<init>(WindowEvent.java:219)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:620)
   at java.awt.Component.dispatchEventImpl(Component.java:3907)
   at java.awt.Container.dispatchEventImpl(Container.java:2068)
   at java.awt.Window.dispatchEventImpl(Window.java:1774)
   at java.awt.Component.dispatchEvent(Component.java:3869)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:275)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:196)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:182)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Title: Mac-Intel Version?
Post by: tanukitzu on March 11, 2006, 18:14:33
Quote from: "princec"Do any of our games (Puppygames) run on your Intel Mac? Last I heard they were working just fine.

Cas :)

Tribal Trouble and Alien Flux do not start (again, how do I get the log on these?)

Puppy Invaders, Blobbit Dash, Ultratron and Titan Attacks do work.

The stack trace I posted above was probably from the Safari applet of puppy invaders closing and not from Tribal Trouble.  My mistake.

Let me know how I can contribute.
Title: Mac-Intel Version?
Post by: tanukitzu on March 12, 2006, 02:37:16
I tried installing lwjgl-macosx-0.99 on my new Intel IMac and I got the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/me/Desktop/lwjgl-macosx-0.99/native/liblwjgl.jnilib:
       at java.lang.ClassLoader$NativeLibrary.load(Native Method)
       at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
Title: Mac-Intel Version?
Post by: princec on March 12, 2006, 13:52:22
Tribal Trouble is written by Elias & friends at Oddlabs (http://oddlabs.com). My games are 'Flux, Ultratron and Titan Attacks, and I can tell you the logs should be stored under ~/<game name><version> and are called err.log and out.log generally.

There may be native log files too from the JVM but I don't know where they go on the Mac (too new to Macs!).

I'd like to find out why Alien Flux doesn't work because it's the same code as the other two...

Cas :)
Title: Mac-Intel Version?
Post by: tanukitzu on March 12, 2006, 17:48:29
Quote from: "princec"I can tell you the logs should be stored under ~/<game name><version> and are called err.log and out.log generally.

I found the folder '~/Library/Alien Flux 1.6/' but it was empty.

There is no folder for Tribal Trouble.

Quote from: "princec"There may be native log files too from the JVM but I don't know where they go on the Mac (too new to Macs!).

I can't find the JVM log either.  You can set the log to be viewable under the 'Java Preferences' utility but the console only shows up for applets.

Any help on finding the log would be well appreciated.
Title: Mac-Intel Version?
Post by: miu on March 13, 2006, 14:43:16
Hi tanukitzu!

I reported some issues to Cas @ Puppygames, here's what should work now:

Titan Attacks - one release had a config glitch, try to redownload if it doesn't start.

Alien Flux - needs to be repackaged for Universal Mac, however swapping libraries from the Titan worked for me. Let me know if you need help here.

LWJGL 0.99 has the same issue, swapping libs from Titan will make GL/AL work as I reported earlier. I may post some more detailed info (and/or the lib package) if needed.

Oddlabs' Tribal Trouble works (almost) fine for me, make sure you have the latest download.

I was getting random crashes to desktop though, logs were automatically submitted to Oddlabs. Rebooting the machine seems to have helped, I was playing and fiddling with many more-or-less working LWJGL games that day, maybe the machine was "confused"...
Title: Mac-Intel Version?
Post by: elias on March 14, 2006, 08:07:28
As you can see, LWJGL actually does support universal binaries, but it is not included in 0.99. I think it's time for another release.

- elias
Title: LWJGL - new release
Post by: miu on March 14, 2006, 14:47:45
I couldn't agree more, Elias! That's kind of what I was suggesting earlier  :wink:

I don't know how far the 1.0 is, but perhaps just a 0.99 Mac release update for Intel would be sufficient?

A look at the "inventory":

- Core GL/AL - done by Elias
- FMOD3 - available as reported by Matzon
- DevIL - tricky but compilable as reported by numberR

Anything else is left? I guess FMOD and Devil will need some Java wrapper work as well?

Just curious - who's the LWJGL "Mac platform coordinator"?

I can offer my MacTel HW and precious free time for testing. I'm able to build/debug Java projects (Eclipse); with some effort I should be able to do C in XCode too (only tried simple examples so far, not familiar with Universal issues/practices yet)...
Title: Mac-Intel Version?
Post by: elias4444 on March 29, 2006, 17:35:25
Any updates? (I'm mostly just curious if anything was decided for sure on what to do)

My work is now telling me it's time to order my next machine, so if I'm going to go Mac, now is my chance. I don't want to do it though if I can't develop my games on it in my off time.  :roll:
Title: Mac-Intel Version?
Post by: Matzon on March 29, 2006, 18:22:38
mactel will be supported as best as is possible, however someone needs to commit to doing the work - I will look into the loading of fmod and devil, where possible - I just haven't found the motivation to do it. I dont have access to a mactel, and I have no incentive to fix it. Especially since I've gotten a copy of Oblivion!
Title: Mac-Intel Version?
Post by: elias4444 on March 29, 2006, 18:52:19
QuoteEspecially since I've gotten a copy of Oblivion!
Ohhhh! So THATs where you've disappeared off to. :P
Can't say that I blame you.

Well, honestly, in my games, I don't use devil or fmod. Is openGL and openAL working fine?

Also, for anyone out there that uses a Mac... how good is Mac OSX as a development platform? (mostly Java stuff)
Title: Steve Jobs doesn't care about Java People
Post by: tanukitzu on March 29, 2006, 18:59:05
I have the new Intel IMac and it's a nightmare for Java development.  It's painfully obvious that no one at Apple takes Java seriously and they are totally ignorant of the Java Open Source community.

I got an IMac G5 as a replacement and I'm selling both IMacs as soon as Vista comes out.  I'm going to set up a workstation where Vista is controlled by Linux server using Norton utilities.  I may keep a couple Mac minis around just for building/testing on them.

The only people using Macs are artsy types and LAMP/Ruby hackers.   It is not for Java.
Title: Mac-Intel Version?
Post by: elias4444 on March 29, 2006, 19:53:19
Ouch. Good to know, thanks!
Title: Mac-Intel Version?
Post by: princec on March 30, 2006, 23:27:53
Oh I dunno, seems fine to me. The Intel OpenAL lib on the Mac, on the other hand, is causing me a major headache. Keeps crashing.

Cas :)
Title: Mac-Intel Version?
Post by: elias4444 on April 02, 2006, 18:53:25
How easy is it to work with Apple's Java implementation as opposed to Sun's "official" distribution of Java? I'm seriously considering the Mac, but am nervous, as I'm really not that familiar with the MacOS (but I've got several friends trying to talk me into it right now).
Title: Mac-Intel Version?
Post by: elias on April 03, 2006, 06:06:36
The way I see it:

1. If you're going to support Mac OS X, having a Mac is considerably easier. I know Cas didn't have a mac for at least a few years, but he also bugged us about testing and debugging his games :)
2. The Intel macs are considerably faster than the PPC ones. So you can finally get PC performance with Mac OS X.
3. The intel mac JVM has worked fine for us. The recent intel mac mini broke TT since the intel gfx drivers has broken ARB_texture_compression support, but that's hardly the JVM's fault.
4. Proper security model which means far fewer (if any) vira, worms and trojans.

If only seen one downside developing on a mac:
1. The Terminal and iTerm programs both suck for regular use. Since I code in VI, this is a problem, but if you're using an IDE then you're not going to notice at all.
2. Most (non-java) games doesn't work for it, indie or non-indie :) But that's the same story as for linux, so I don't even notice that.

All in all, go for the intel mac :)

- elias
Title: Mac-Intel Version?
Post by: elias4444 on April 05, 2006, 14:43:58
Well, now I see no reason why I shouldn't go for an Intel Mac:

http://www.apple.com/macosx/bootcamp/

Exciting stuff! Especially for us cross-platform game developers.  :D
Title: hmmmmmm...
Post by: Fool Running on April 05, 2006, 19:12:34
QuoteWell, now I see no reason why I shouldn't go for an Intel Mac:

http://www.apple.com/macosx/bootcamp/
Windows on a Mac?!?!?!.... What is this world comming to? :lol:
Next thing you know, Mac OS will run on a Windows machine and there won't be any hardware difference between the two!  :roll:
Title: Mac-Intel Version?
Post by: miu on April 18, 2006, 17:11:08
tanukitzu - While I agree that many aspects of Java on the Mac are different from other implementations (packaging), overall it works just fine. Afer all, Linux/Solaris packaging is also different from Windows. LWJGL-Mactel "issues" are not really Java related at all, it's the native dependencies.

elias - good to hear that your (or better said Intel's?) mac mini bug is now fixed!

bootcamp - this is very interesting! We all somehow knew if would happen, I'm surprised that the solution comes directly from Apple and so soon!

I believe it's a good reason to go for an Intel Mac and get the best of both worlds! There is very little HW difference now (anything else than BIOS/EFI?). Still, no one makes anything like an iMac or the mini!

As many observed elsewhere however, this may indeed kill Mac gaming since mainstream games will be available as Windows "originals" without the wait and generally for less $$$. Often there's better performance etc.

Multi-platfrom developers like Oddlabs or Puppygames will not notice (I guess their non-Windows sales are negligible, if they can trace them) but for Aspyr or Feral future may be gloomy.

Fact is that "legacy" Power PC Macs will still be a good market for a while so the "bootcamp effect" may be delayed.
Title: Mac-Intel Version?
Post by: elias on April 18, 2006, 17:53:55
We sell quite a lot to mac users (about 40%), but the main point is that I don't think boot camp will be such a big deal for the indie games. No-one wants to reboot just to get a quick fix of Tribal Trouble, Titan Attacks or something else.

- elias
Title: Mac-Intel Version?
Post by: miu on April 18, 2006, 21:54:38
That's a surprisingly high percentage, elias! Obviously Java game audience is not "average"...

Luckily, no one needs to reboot for your games since they always come in all varieties.

This bootcamp sub-thread is off-topicky, but still:

My Intel iMac is the most powerful HW in the house now. Ever since I got it I wanted to find something to benchmark/showcase its graphics and processing power. What's better than a game, right? But there was NOTHING available for Intel (I know Apple took everybody by surprise in January). I tried a few PPC game demos, but their performance sucks, especially if you want nice graphics.

Then Doom 3 got a Universal update, but I didn't feel like shooting zombies in dark corridors. Call of Duty 2 should be coming in May, that's a looong wait. Now Quake 4 was released - still too close to Doom for me, but I tried to research and get it.

Compared to the Windows version it costs 50+ % more, and even though I still wanted it, I couldn't get it locally. I know I could mail order, but I'm an "impulse buyer".

Then I found that the Win version already has a multi-core patch out, which dramatically improves performance, also there's an SDK for mods... it may be coming "later" for Mac, but I just grabbed the Win version now. So wow, now I can see how my Mac shines - in Windows  :(

Now I feel bad about my "impulse" decision, perhaps I should have supported my camp? Their position is pretty bad since they have to deal with PPC code as well as Intel, which will never be as optimized as Windows. I don't think they can justify that effort for a limited market.

I promise I'll get a "real" Mac game one day...
Title: Mac-Intel Version?
Post by: elias4444 on April 25, 2006, 16:23:21
Well, my new MacBook Pro is on it's way! Is there a universal version of LWJGL available for download for Intel Macs yet? I'd prefer not to have any development downtime once I get it.
:wink:
Title: Mac-Intel Version?
Post by: princec on April 25, 2006, 16:24:56
You can grab it indirectly out of Titan Attacks for OSX for now.

Cas :)
Title: Mac-Intel Version?
Post by: elias4444 on April 25, 2006, 18:25:00
Cool, thanks!
Title: Mac-Intel Version?
Post by: gregorypierce on April 26, 2006, 15:38:35
You guys may find this article helpful in building the universal binary of several supporting LWJGL libraries:

http://developer.apple.com/opensource/buildingopensourceuniversal.html