Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java on the Mac  (Read 2182 times)
0 Members and 1 Guest are viewing this topic.
Offline Alan_W

JGO Knight

Medals: 8
Projects: 3

Java tames rock!

« Posted 2005-05-21 21:01:37 »

I bought a powerbook g4 and am having trouble getting java to work correctly.  I installed OS X 10.4.1 and Xcode2 dev tools & slapped Netbeans 4.1 on top.

I compiled the exxample Anagram application Ok, but when running it got:

2005-05-21 23:43:32.085 java[942] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0xd803, name = 'java.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2005-05-21 23:43:32.085 java[942] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)

The app then ran apparently correctly.  I wrote a console "Hello World" app & that ran without error.  I installed Java 1.5 & configured it as the default JRE for apps, but still the same error.  A search on google found some Oracle developers having a similar problem & solved it by mv'ing libraries when compiling.  However that was for C.  Maybe the java native libs are broke on OS X 10.4?

Secondly I fired up my Storm the Castle software rendered 3D applet using safari web-browser on the Mac and got less than 2FPS (count em thats TWO frames per second) on a 1.67GHz machine.  I get around 40fps on a 2.8GHz Pentium PC.  Ouch Ouch Ouch.

I wasn't expecting 40fps because I hadn't optimised out all the floating point in the inner loops, but this should only really make a relatively small difference.  Ok, the mac clock frequency is less than the PC, but the powerPC processor is supposed to be faster than a Pentium at the clock rate.  Even being pessimistic, surely the framerate shouldn't have dropped below around 10 to 15fps.

Not very cross platform when it's 20 times slower, perhaps only 15 times slower with a following wind.

Maybe I've made a ghastly mistake.  Maybe it's safari.

This machine seems to have a problem with the xx key too. I always get two xx's for a single keypress.  It might have to go back.

qwertyuiopasdfghjklzxxcvbnm - see two xx's again


/Edit - I think the keyboard debounce is not quite up to the job.  I tweaked the acceptance delay in the 'Universal Access' (i.e. disabled) preferences a tad & that seems to have done the trick with the dodgy x's (see a single x) x x x all singles - so the question is do I complain about it since the fix works fine.

/Edit - There's definitely something duff about the x key, it starts sending 'x' when you just rest your finger on it.  Looks like a noisy set of contacts. Will attempt to exchange machine. *Sigh* And this was my first mac.

/Edit - swapped it - now i can type xylophone, xmas and xanadu.  Think I'll go profile my app, if I can find where the appletview is Wink

Time flies like a bird. Fruit flies like a banana.
Offline Jeff

JGO Coder

Got any cats?

« Reply #1 - Posted 2005-05-24 20:21:25 »

How are you doing your 3D?  What are you rendiering to/with?

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!
Offline Alan_W

JGO Knight

Medals: 8
Projects: 3

Java tames rock!

« Reply #2 - Posted 2005-05-25 04:03:44 »

The Storm demo used software rendering, so the delay is either due to Hotspot on the mac not being as aggressive or more likely to do with my blitting a large ImageBuffer to the screen every frame.

The bufferedImage in question is created:

screen = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
DataBuffer buffer = screen.getRaster().getDataBuffer();
screenData = ((DataBufferInt)buffer).getData();

The code that fills the buffer is complex, but the inner loop is:

while ((x<x2) && (zBufferY
  • < zi)) {
  • = zi;

    screenData[BufferX++] = palette[
     textureData[((int)tx1 & xMask) |
     (((int)ty1 & yMask)<<widthBits)] & 0xff];

    tx1 += dtx;
    ty1 += dty;
    zi += dzi;

Finally the image is drawn on the screen using code similar to:

Graphics g = getGraphics();
g.drawImage(screen, 0,0,width,height,null);

Time flies like a bird. Fruit flies like a banana.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »

Medals: 1033
Projects: 3
Exp: 20 years

Eh? Who? What? ... Me?

« Reply #3 - Posted 2005-05-25 08:59:16 »

The Mac Java2D pipeline is 100% software, and then that's layered on top of the rather complicated OSX rendering engine itself. It's very slow. The actual JVM implementation itself is more or less on a par with the Intel Hotspot clients as far as I can tell.

If you want x-platform performance... you need LWJGL or JOGL and a thorough understanding of OpenGL.

Cas Smiley

Offline kevglass

« JGO Spiffy Duke »

Medals: 319
Projects: 25
Exp: 22 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #4 - Posted 2005-05-25 09:04:13 »

The new Java2D implementation in the latest (Mac) VM is meant to be a big improvement.


Offline Alan_W

JGO Knight

Medals: 8
Projects: 3

Java tames rock!

« Reply #5 - Posted 2005-05-25 16:19:23 »

Thanks for the feedback chaps,

Kev: The 1.5.0 VM got me up to about 3FPS  Grin

I have to agree with Cas, using java2D to shift large bitmaps about just doesn't seem to work on the mac.  

Maybe INT_RGB doesn't match the underlying display capabilities & a painstaking conversion is taking place.

It will be interesting to see if my entry for LWJGL16k runs better Smiley

Time flies like a bird. Fruit flies like a banana.
Pages: [1]
  ignore  |  Print  

EgonOlsen (42 views)
2018-06-10 19:43:48

EgonOlsen (22 views)
2018-06-10 19:43:44

EgonOlsen (43 views)
2018-06-10 19:43:20

DesertCoockie (197 views)
2018-05-13 18:23:11

nelsongames (124 views)
2018-04-24 18:15:36

nelsongames (123 views)
2018-04-24 18:14:32

ivj94 (863 views)
2018-03-24 14:47:39

ivj94 (124 views)
2018-03-24 14:46:31

ivj94 (768 views)
2018-03-24 14:43:53

Solater (140 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!