Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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 1169 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 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: 8
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

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


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

JGO Kernel


Medals: 121
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« 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: 8
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.

 

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

The first screenshot will be displayed as a thumbnail.

CogWheelz (11 views)
2014-07-30 21:08:39

Riven (21 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (29 views)
2014-07-23 21:07:15

Riven (30 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!