Mac OS X users, please try out this game

I got report that GTGE not working with Mac OS X.
And the exception is really weird, ClassCastException while drawing image :frowning:
As I don’t have Mac OS X, I don’t know is this something wrong with Mac OS X, or there is something wrong with his Java.

So Mac OS X users, please try this out and see if you got same exception or not :
http://goldenstudios.or.id/products/games/bin/demorpgopengl.jnlp

And some games in here to be sure that it’s really working on Mac OS X or not :
http://goldenstudios.or.id/products/games/

The exception is thrown when I create new buffered image, grab the graphics and draw an image into it :


   int width, height;
   BufferedImage img = CONFIG.createCompatibleImage(width, height, Transparency.BITMASK);

   Graphics2D g = img.createGraphics();

   // in here the exception thrown, ClassCastException
   g.drawImage(otherImage, 0, 0, null);

   g.dispose();

This is the exception :


java.lang.ClassCastException
      at 
sun.awt.image.BufImgSurfaceData.createData(BufImgSurfaceData.java:434)
      at 
sun.java2d.SurfaceData.getSurfaceDataFromImage(SurfaceData.java:101)
      at apple.awt.CRenderer.blitImage(CRenderer.java:477)
      at apple.awt.CRenderer.scaleImage(CRenderer.java:443)
      at apple.awt.CRenderer.copyImage(CRenderer.java:497)
      at apple.awt.CRenderer.copyImage(CRenderer.java:581)
      at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:147)
      at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2957)
      at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2947)
.................

Thank you so much

yup i got that error. :frowning:

What the?? ClassCastException in drawing image???
Could you try out below test case to try out is that code really not working on Mac OS X?


   GraphicsConfiguration CONFIG = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();

   BufferedImage image = ImageIO.read(....); // read the source image


   BufferedImage img = CONFIG.createCompatibleImage(image.getWidth(), image.getHeight(), Transparency.BITMASK);
 
   Graphics2D g = img.createGraphics();
 
   // in here the exception thrown, ClassCastException
   g.drawImage(image, 0, 0, null);
 
   g.dispose(); 

So what’s wrong with this anyway, anyone know? Is there any workaround for this (for Mac OS X)?
Cos GTGE is reported to be working fine in Linux, and of course Windows (I use Windows XP).

The demo rpg works fine on my Ibook not much to do on the demo except walk around

Wow this is getting weird, with some Mac OS it works, but not with other.
Perhaps this is something with the Java version.
What Java version do you use JoC and daniel131313?

Yup, there is not much to do, that’s a demo only, I’m making game engine, so the demo must be as simple as possible, so the user can understand the source and start making they own or expand it :slight_smile:

Thanks for trying it.

Another Mac? Please…
I need to sure the engine is working on the three major platform, Windows, Linux, and Mac.

i did some more testing. It works in fullscreen without any problem but fails in windowed mode.

My java version is 1.4.2_05-141.3

Mac OSX 10.3.8
Java 1.4.2

Tried JOGL Fullscren option and got a blank white screen. :confused:

[quote]It works in fullscreen without any problem but fails in windowed mode.
[/quote]
That’s totally strange :frowning:

Is the Java2D and LWJGL is working ribot?
If you use ATI card, then it’s not Mac OSX problem, but it’s because JOGL is not working on ATI card.
And I don’t know when they will fix this problem.

Worked without any errors whatsoever in Java2D mode!

Tried it out in LWJGL mode too - I thought it wasn’t going to launch when the following error popped up:

Java Web Start 1.4.2_05 Console, started Fri Mar 04 11:12:15 GMT 2005
Java 2 Runtime Environment: Version 1.4.2_05 by Apple Computer, Inc.
Logging to file: webstart_log
java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at org.lwjgl.Sys.(Sys.java:69)
at org.lwjgl.opengl.Display.(Display.java:92)
at com.golden.gamedev.engine.lwjgl.LWJGLMode.q(Unknown Source)
at com.golden.gamedev.engine.lwjgl.LWJGLMode.d(Unknown Source)
at com.golden.gamedev.engine.lwjgl.LWJGLMode.(Unknown Source)
at com.golden.gamedev.OpenGLGameLoader.setupLWJGL(Unknown Source)
at com.golden.demorpg.DemoRPGSettings.start(DemoRPG.java:131)
at com.golden.gamedev.funbox.GameSettings.run(Unknown Source)
at java.lang.Thread.run(Thread.java:552)

But the loading continued and I was able to play the game.

Hope this feedback helps.

Err perhaps that’s because I add wrong file as the nativelib, I add only liblwjgl.jnilib for Mac OS

Anyway is the game window has icon or only white blank icon?
If it has icon then it must be fail back to Java2D mode, cos if the OpenGL not working (LWJGL or JOGL), it will use Java2D mode then.
if it doesn’t have icon (white blank icon) then it is LWJGL mode, but that’s weird, if it can’t find the native lib why it can launch the lwjgl mode?

Anyway this is my jnlp for Mac OS native lib:


<resources os="MacOS">
   <j2se version="1.4+"/>
   <nativelib href="lwjgl-osx.jar"/>
   <nativelib href="jogl-natives-macosx.jar"/>
</resources>

The lwjgl-osx.jar only has liblwjgl.jnilib
Is this the right parameter? I never use other OS than Windows, I don’t know how to fix it :frowning:

Thanks for trying it again :slight_smile:

Use “Mac”

Oh it’s only Mac not MacOS?
Fixed! please try again, thanks :slight_smile:

Java2D and LWJGL now worked fine in both fullscreen and windowed mode. :slight_smile:

Alright thanks!! :slight_smile:

GTGE fully working in Mac now! :smiley:

Things now seem to work in all modes except for JOGL :frowning:

I have tried all combinations - fullscreen, windowed, vsync, no vsync - same error every time: after a black screen the screen goes white and the cursor is centered (in fullscreen mode)…

… then nothing happens. :confused:

Let me know what you’d like me to check. Webstart should automatically download new versions of JOGL or do I have to manually do this?

Here’s what is printed to my log:

Java Web Start 1.4.2_05 Console, started Wed Mar 09 11:26:54 GMT 2005
Java 2 Runtime Environment: Version 1.4.2_05 by Apple Computer, Inc.
Logging to file: webstart_log
Using ATI workaround of dispatching display() on event thread

Yup JOGL has some issues on ATI card, the display is screwed, that’s not GTGE fault :stuck_out_tongue:

The most important is Java2D mode is working in Mac. It’s the main environment.
If the LWJGL is working it’s even better.
If JOGL is not working, I don’t care :stuck_out_tongue:
JOGL is the last option to use anyway, cos for user that want to use OpenGL I will still recommend to use LWJGL (much smaller in size, more stable, and game oriented)