LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: hbomboy on June 10, 2004, 07:01:12

Title: Where does mac support stand?
Post by: hbomboy on June 10, 2004, 07:01:12
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 :-)
Title: Where does mac support stand?
Post by: princec on June 10, 2004, 09:22:12
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 :)
Title: Where does mac support stand?
Post by: swpalmer on June 11, 2004, 01:19:31
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?
Title: Where does mac support stand?
Post by: hbomboy on June 11, 2004, 01:30:01
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 :-)
Title: Where does mac support stand?
Post by: swpalmer on June 11, 2004, 02:00:52
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...
Title: Texture loaders
Post by: hbomboy on June 11, 2004, 04:07:13
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 :-)
Title: Where does mac support stand?
Post by: swpalmer on June 11, 2004, 04:22:34
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.
Title: Where does mac support stand?
Post by: Matzon on June 11, 2004, 06:42:32
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.
Title: Re: Texture loaders
Post by: cfmdobbie on June 11, 2004, 08:22:39
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
Title: Where does mac support stand?
Post by: princec on June 11, 2004, 08:22:42
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 :)
Title: Where does mac support stand?
Post by: hbomboy on June 11, 2004, 08:40:36
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!
Title: Where does mac support stand?
Post by: princec on June 11, 2004, 09:55:21
Actually that is one of the solutions we're thinking of using to get LWJGL working properly on the Mac :oops:

Cas :)
Title: Where does mac support stand?
Post by: cfmdobbie on June 11, 2004, 11:00:36
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?
Title: Where does mac support stand?
Post by: swpalmer on June 11, 2004, 12:03:40
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.
Title: Where does mac support stand?
Post by: swpalmer on June 11, 2004, 12:16:47
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'.
Title: Where does mac support stand?
Post by: hbomboy on June 17, 2004, 20:08:18
re mac input...
has anyone tried using jinput in conjunction with lwjgl?  Will that manage to pick up input events with awt, and lwjgl running?  perhaps a sily idea, and jinput might be a dirty word in this forum :-!  but i was wondering if that might work.  Id try it myself, but i cant get the bianary files from jinput (the current bianary archive has no compiled files, and I think im missing the native compiler)  wondering if anyone has tried that, or if anyone can find/ build the mac jinput for me :-)
Title: Where does mac support stand?
Post by: hbomboy on June 18, 2004, 21:30:38
manager to compile jinput, thanks anyway :-)  JEEZE ITS SOOOO CONFUSING compared to lwjgl.  why the devil does a keyboard need to be treated as 115 sepperate devices!!!! for crying out loud this is just sillyness.  I like the light philosophy so much better.  simple, clean, effective.  any opiniions obout adding game controller support in the future?
Title: mac cocoa port
Post by: hbomboy on June 18, 2004, 22:07:50
hey... I have a real hard time following cocoa... but it looks to me like this app does just about all that you need with regards to mac support.  perhaps im way off... but have a look for me :-)


http://developer.apple.com/samplecode/NSOpenGL_Fullscreen/NSOpenGL_Fullscreen.html

hope its helpfull
(I guess sans a mac it wont make any sence... so what it does... is make a windowed opengl session through cocoa, it looks like at least, and then with the click of a button it turns that into fullscreen opengl.  hitting the escape key will then take it out of fullscreen and back into windowed mode.  correct me if im wrong... but instantiating an opengl window, a fullscreen opengl window, and being able to recognize keystrokes (ie the escape key) seems like a good part of whats needed for the mac, no?)
Title: Where does mac support stand?
Post by: hbomboy on June 18, 2004, 22:12:38
ps, it handels other keys as well... w for wireframe, and.... MOUSE INPUT (!!) also
Title: Where does mac support stand?
Post by: elias on June 19, 2004, 19:29:51
I'll take a look at it when I get a hold of a mac. The great thing about cocoa is that you don't have to use objective c - there is, as far as I know, java bindings for all the cocoa API. Should make it a lot easier, and avoid much annoying JNI fiddling.

- elias
Title: Where does mac support stand?
Post by: hbomboy on June 19, 2004, 23:40:47
from what ive read... hid input can be a little tricky, i think that exmple uses events instead, but also from what ive read, hid can be iffy, and events have been argued to be jsut as fast anyway :-\
Title: Where does mac support stand?
Post by: PlanetMongo on June 20, 2004, 02:35:47
So, um.. in the spirit of "I got an iBook to "learn" game development using LWJGL" but not in actuality.. erm..

Is LWJGL usable under OS X and/or what limitations can I expect at the moment?  Can I use gamepads?  Sound?  ??
Title: Where does mac support stand?
Post by: princec on June 20, 2004, 09:02:07
As far as I'm aware it works fine except for two things: you can't use Windowed mode and it won't deploy under Webstart properly because Swing blocks our mouse & keyboard input.

Cas :)