Mac OS X port ready

Started by elias, November 11, 2004, 16:08:03

Previous topic - Next topic

elias

... at least ready enough for comments and testing. The files are at:

http://odense.kollegienet.dk/~naur/liblwjgl.jnilib

and

http://odense.kollegienet.dk/~naur/lwjgl.jar

and

http://odense.kollegienet.dk/~naur/openal.dylib

The port is pretty much complete, with some known issues:

1. No Controller support
2. No Pbuffer support. 10.2 have only in-memory pbuffers, and 10.3 only have render-to-texture, so we'll have to restructure the LWJGL Pbuffer interface to make Mac OS X fit.
3. Mode capping. This happens on my Mac, but apparantly not on e.g. Scott Palmer's. See

http://www.javagaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=2D;action=display;num=1100087097

for a full explanation.
4. Native cursors are reset to the default cursors when the LWJGL window is deactivated and then re-activated. Looks like an AWT bug, because even the simplest program exhibits this behaviour:

import java.awt.*;
import javax.swing.*;

public class cursortest {
    public static void main(String[] args) {
        JFrame f = new JFrame();
        Button b = new Button();
        f.getContentPane().add(b);
        f.pack();
        f.setBounds(10, 10, 100, 100);
        f.setVisible(true);
        b.setLabel("Waiting cursor here");
        b.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    }
}


The cursor is always the waiting cursor (even when the cursor is outside the button), but after deactivation, the default pointer is shown, always. Another setCursor doesn't help, and getCursor returns the correct cursor too.

5. When in fullscreen and using native cursors, no mouse moved events are reported in the top few pixels of the window. Don't know what is causing this.

- elias

[EDIT] Issue 6 is fixed

elias

... and I almosts forgot

7. Only a boneheaded Makefile for the native library in src/native/macosx. I'm sure someone will have mercy and createa better build system.

 - elias

Chman

Nice work !!!
This binding has been waited by so many people...
Thanks !

Chman

elias

Thank you. As a measure of stability, I can tell you that Tribal Trouble runs flawlessly on the Mac now, and we've even tried a networked game against all the other LWJGL platforms :-)

- elias

Chman

That's good ! I'm also waiting for tribal trouble which looks more and more interesting !

Chman

Erestar

Speaking of Tribal Trouble, I sighed up on the forum when I saw the beta stuff was starting, but I guess I picked the 13 or under option. I emailed someone about this but forget who and never heard back.

Can anyone fix me? ;)

Erestar

elias

If you filled out the beta application form, we have you in the system :-) In a few days we'll let in a lot more testers to stress the multiplayer part of the game. For now, we only have a few testers to make sure everything runs alright.

- elias

the2bears

Quote from: "elias"Thank you. As a measure of stability, I can tell you that Tribal Trouble runs flawlessly on the Mac now, and we've even tried a networked game against all the other LWJGL platforms :-)

- elias

That is just really cool!  Congratulations both for the Mac port and TT.

Bill
the2bears - the indie shmup blog

itistoday

I'm getting a LOT of errors trying to run programs with this.  Most of them seem to be caused by a lack of a "Display" or "Window" class.  I'm new to lwjgl so bear with me.

Example errors from javac:
Lesson01.java:9: cannot resolve symbol
symbol  : class Display 
location: package lwjgl
import org.lwjgl.Display;
                 ^
Lesson01.java:10: cannot resolve symbol
symbol  : class DisplayMode 
location: package lwjgl
import org.lwjgl.DisplayMode;
                 ^
Lesson01.java:12: cannot resolve symbol
symbol  : class Window 
location: package opengl
import org.lwjgl.opengl.Window;

I've put the posted files in my ~/Library/Java/Extensions/ folder. On a mac, this both the java.ext.dirs folder and the java.library.path folder.

trevorsm

Quote from: "itistoday"I'm getting a LOT of errors trying to run programs with this.  Most of them seem to be caused by a lack of a "Display" or "Window" class.  I'm new to lwjgl so bear with me.

I had a problem with this too: it seems that LWJGL changes around a bit from time to time. In this particular case, the org.lwjgl.opengl.Window class is gone and Display has moved to org.lwjgl.opengl.Display, which seems to have broken programs that ran on older versions of LWJGL.

Check the Sample Code section in the LWJGL Wiki for code that works with the newer library. http://lwjgl.org/wiki/tiki-index.php?page=Basic+Game+FrameworkThis is a good bet, but you'll have to remove the static imports from the code since Apple hasn't released Java 1.5 for OSX yet. :evil:

itistoday

Quote from: "trevorsm"
Quote from: "itistoday"I'm getting a LOT of errors trying to run programs with this.  Most of them seem to be caused by a lack of a "Display" or "Window" class.  I'm new to lwjgl so bear with me.

I had a problem with this too: it seems that LWJGL changes around a bit from time to time. In this particular case, the org.lwjgl.opengl.Window class is gone and Display has moved to org.lwjgl.opengl.Display, which seems to have broken programs that ran on older versions of LWJGL.

Check the Sample Code section in the LWJGL Wiki for code that works with the newer library. http://lwjgl.org/wiki/tiki-index.php?page=Basic+Game+Framework is a good bet, but you'll have to remove the static imports from the code since Apple hasn't released Java 1.5 for OSX yet. :evil:
I remove the static from the imports and get this error:
/Users/gslepak/Desktop/Java Stuff/lwjgl/demos/Game.java:18: ';' expected
	private static enum       gameStates {INIT, RUNNING, EXIT};
                                             ^
/Users/gslepak/Desktop/Java Stuff/lwjgl/demos/Game.java:74: ';' expected
			for (DisplayMode currentMode : modes) {
                                                     ^
/Users/gslepak/Desktop/Java Stuff/lwjgl/demos/Game.java:83: illegal start of expression
		} catch (Exception e) {
                ^
3 errors

trevorsm

Has anyone else been having trouble getting keyboard input to work? I've been trying to use the Keyboard.isKeyDown() function, but it always returns false. The same code I've been tring works fine on Windows.

itistoday

Quote from: "trevorsm"Has anyone else been having trouble getting keyboard input to work? I've been trying to use the Keyboard.isKeyDown() function, but it always returns false. The same code I've been tring works fine on Windows.
(thanks for the pm).
Doesn't work for me either.  Why does LWJGL even have keyboard/mouse support? Shouldn't this all be done by AWT/Swing?

Gom Jabbar

Quote from: "itistoday"I remove the static from the imports and get this error:
/Users/gslepak/Desktop/Java Stuff/lwjgl/demos/Game.java:18: ';' expected
	private static enum       gameStates {INIT, RUNNING, EXIT};
                                             ^
/Users/gslepak/Desktop/Java Stuff/lwjgl/demos/Game.java:74: ';' expected
			for (DisplayMode currentMode : modes) {
                                                     ^
/Users/gslepak/Desktop/Java Stuff/lwjgl/demos/Game.java:83: illegal start of expression
		} catch (Exception e) {
                ^
3 errors

You have to redo that bit too, Enum's aren't supported prior to Java 1.5 either. Just throw out all references to gameState(s) and add a boolean to keep track of whether the game is running or not. If you don't know how to do this give me a shout and I'll post some source...

Gom Jabbar

Damn, I just realized that the for loop won't work in Java versions < 1.5 either.

I'm gonna add some comment to the Basic Game Framework code clarifying this and provide alternative ways of doing it in earlier versions. I hope to get it done in some minutes, if not I fell asleep and will do it tomorrow. Afterall it's 1:45 am already...