Where does mac support stand?

Started by hbomboy, June 10, 2004, 07:01:12

Previous topic - Next topic

hbomboy

Hey,
I'm working on the mac side of JME.  There are some issues with its mac support, and so im curious where does mac support lie in lwjgl?  Windowig mode is not supported yet, right?.  There is some speculation that use of awt kills keyboard/input focus for lwgjl.  Is this this true, and to what extent?  is it because awt initializes its own mouse/keyboard listeners?  Anything else I should be aware of that isnt ready on the mac side, before I freak out and try to fix it hoplessly in jme?  Thanks a lot! -David
(OH, and lwjgl rocks!  great job cas :-)

princec

These days it's more Elias who makes LWJGL rock :) Scott Palmer says he's working on the Mac port again at the moment. I expect it will be a while before he's up to speed; there's some talk of porting the whole lib up into Cocoa which will smooth things out considerably.

In the meantime Elias says he might try a hack to get input working using HID.

Cas :)

swpalmer

Ok... rather than clutter javagaming.org with my incompetence I guess I will post here.

I finally am getting somewhere with building the latest LWJGL on the Mac.  I have managed to learn the secret to running 'strip' so I don't get a 4.8 MB library :)  ..  however at the moment I only get a 265kB library and I haven't got anything to test it with as it clearly doesn't work with the version of Alien Flux that I have.
I get:
[JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
Exception in thread "main" java.lang.UnsatisfiedLinkError: setTime
   at org.lwjgl.Sys.setTime(Native Method)
   at org.lwjgl.Sys.initialize(Sys.java:120)
   at org.lwjgl.Sys.<clinit>(Sys.java:88)
...

btw Cas the Mac download you have for Alien Flux is crap - I told you about that before... it includes the Linux and Windows DLLs for no reason and it is not packaged in the 'standard' way for a Java app on a Mac.  I built a new version for you ages ago. Is there a reason you aren't using it?

hbomboy

so with no-one chiming in about awt support... i guess im to assume this hasent been a problem?  It seems if any awt code is called at all (obviously not for window managment, but for texture conversion and the like), we loose keyboard/mouse focus.  kinda struck me as odd, if this isnt a normal thing, I better start diggin through the code, see if i cant fix it.  let me know.  Thanks all :-)

swpalmer

Yes there is a problem with AWT on the Mac..  As I understand it one thing this can cause is that AWT steals input events from LWJGL.  I have also seen things deadlock depending on when the AWT thread is started.  Typically I've seen the AWT thread get started by the use of java.awt.Image objects when loading graphics resources.   Alien Flux works because Cas implemented his own image compression for textures.


I fixed the problem I mentioned above.. now I get this when I try to launch Alien Flux:
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/openal/ALConstants

And sure enough that class does not exist.  I guess AF is not compatible with the latest LWJGL..  So now I will figure out how to run the lwjgl_test.jar stuff...

hbomboy

Hey Cas, what texture loaders did you write?  Can I use them for JMonkey? They are in spgl, no?  i found a jpeg one... but it looked like it was for win32.  Ive run AF on my mac, so I know you must have done something! :-)  can you point me in the right direction?  Thanks :-)

swpalmer

Ok.. so my small 265kB LWJGL lib seems to work.  e.g. org.lwgl.test.openal.PositionTest runs.. plays the sound, shows the boxes, and the cursor keys can move the boxes around.

I tried to get Hallucinogenesis to run.. but I got the message Failed to reserve Nvidia ram (My laptop has an ATI chip) and it seemed to hang on a black screen.

Matzon

Quote from: "swpalmer"Ok.. so my small 265kB LWJGL lib seems to work.  e.g. org.lwgl.test.openal.PositionTest runs.. plays the sound, shows the boxes, and the cursor keys can move the boxes around
cool, can you send me a copy (of the build system)? (brian@matzon.dk) I'd like to test it on the Mac I have access to.
I revoked your developer access some time ago (since you were inactive), so I'll need your sf unix name again, to give you commit rights.

cfmdobbie

Quote from: "hbomboy"Hey Cas, what texture loaders did you write?

I believe Cas uses a bespoke format - at build time he loads the graphics using the AWT and outputs his own format, which he then loads at runtime.

Quote from: "swpalmer"but I got the message Failed to reserve Nvidia ram (My laptop has an ATI chip)

I think that message appears for all non-nVidia cards, but shouldn't directly be an issue.

Sounds like excellent progress! :D
ellomynameis Charlie Dobbie.

princec

agh, too many threads in one flat forum!

Alien Flux's distribution was done by an affiliate for various reasons (ie. fixes after you did the build) and I can't update it because I've got no Mac :( Hence dire need to get Webstarted version!

Super Elvis doesn't need Nvidia RAM but it does mention when it can't get it. As for hanging on a black screen... might be useful to find the log files that it writes to your user home/hallucinogenesis directory.

Decompression from JPEG uses AWT (ImageIO) for Super Elvis at the moment. I need a lipjpeg-based decoder which I'm working on but haven't finished yet to get full AWT independence again. Alien Flux predates JPEG compression in SPGL.

Cas :)

hbomboy

Thanks a lot guys! now this is all starting to make some sence :-)  It sounds like I'm way out of my league with the image stuff, but for now I made a class to embrace my lack of keyboard focus due to awt :-)  I just bring up a jframe behind the fullscreen open gl, and have it request focus!  Not clean at all, or probably near as fast... but hey, thats why i got the second g5 chip in there, right?  ;-)  seems like an easy work arround untill the library is ported to cocoa :-)  Thanks again!

princec

Actually that is one of the solutions we're thinking of using to get LWJGL working properly on the Mac :oops:

Cas :)

cfmdobbie

Quote from: "princec"Actually that is one of the solutions we're thinking of using to get LWJGL working properly on the Mac :oops:

Can you not hijack the AWT event thread, and translate messages on the fly into the LWJGL event system?
ellomynameis Charlie Dobbie.

swpalmer

Quote from: "princec"Alien Flux's distribution was done by an affiliate for various reasons (ie. fixes after you did the build) and I can't update it because I've got no Mac :( Hence dire need to get Webstarted version!
Distribute a ZIP instead of .sit and you CAN update at least the non-native bits.

Quotemight be useful to find the log files that it writes to your user home/hallucinogenesis directory.
No luck finding any log file.

QuoteDecompression from JPEG uses AWT (ImageIO) for Super Elvis at the moment.
I think that might be what causes the lock up.

swpalmer

Quote from: "Matzon"cool, can you send me a copy (of the build system)?
I don't have the 'strip x' command in the XCode project yet, and it doesn't put the lib in an easy to get at folder yet.  I read something about  building an XCode project from the command line, so I'm going to try making a small script to build, strip, and copy the lib.

I will send as soon as I tidy it up.

QuoteI revoked your developer access some time ago (since you were inactive), so I'll need your sf unix name again, to give you commit rights.

Actually CVS and I don't get along :) so it is probably just as well. I'm liable to seriously screw stuff up.  I can just send you the 'mac_xcode' folder that I've added to 'platform_build'.