Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
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 1018 times)
0 Members and 1 Guest are viewing this topic.
Offline Alan_W

JGO Knight


Medals: 7
Projects: 3


Java tames rock!


« Posted 2005-05-21 23: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:

1  
2  
3  
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

Argghhhhhhhhh!

/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 22: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!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Alan_W

JGO Knight


Medals: 7
Projects: 3


Java tames rock!


« Reply #2 - Posted 2005-05-25 06: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:
Quote

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:
Quote

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

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

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


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

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


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
« League of Dukes »

JGO Kernel


Medals: 195
Projects: 3


Eh? Who? What? ... Me?


« Reply #3 - Posted 2005-05-25 10: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
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


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

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

Kev

Offline Alan_W

JGO Knight


Medals: 7
Projects: 3


Java tames rock!


« Reply #5 - Posted 2005-05-25 18: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  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (48 views)
2013-05-17 21:29:12

alaslipknot (57 views)
2013-05-16 21:24:48

gouessej (87 views)
2013-05-16 00:53:38

gouessej (85 views)
2013-05-16 00:17:58

theagentd (94 views)
2013-05-15 15:01:13

theagentd (87 views)
2013-05-15 15:00:54

StreetDoggy (132 views)
2013-05-14 15:56:26

kutucuk (153 views)
2013-05-12 17:10:36

kutucuk (153 views)
2013-05-12 15:36:09

UnluckyDevil (163 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.102 seconds with 20 queries.