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 7 and Swing drawing graphics, slow?  (Read 3990 times)
0 Members and 1 Guest are viewing this topic.
Offline zappsweden

Junior Member




Java games rock!


« Posted 2007-07-30 22:16:21 »

When I switched from my Java 5 to Java 6 my Swing drawing lost like 75% of its drawing speed so I had to basically either stay with Java 5 or switch to Java 6 and convert all my code using some better graphics engine. I chose to stay with Java 1.5 for the moment.

Now with Java 1.7 out, has anyone tried it and does it work well drawing Swing or do I need to get away from Swing to get enough frame rates to make a 2D game?
Offline keldon85

Senior Member


Medals: 1



« Reply #1 - Posted 2007-07-30 22:30:22 »

It all depends on what you're doing to draw! Maybe you're just doing it wrong, and why use Swing for your game? Is the AWT not enough?

Offline zappsweden

Junior Member




Java games rock!


« Reply #2 - Posted 2007-07-30 22:31:34 »

I am mostly drawing png's.
Games published by our own members! Check 'em out!
Play the free demo of Revenge of the Titans!
Offline 2playgames

Junior Member





« Reply #3 - Posted 2007-07-30 22:37:18 »

did you test it on another pc? maybe there's some incompatibily between Java 6 and your system, or something went wrong when installing


Offline fletchergames

Senior Member





« Reply #4 - Posted 2007-07-30 23:05:08 »

If you're using transparency, I suspect that the problem is that your images were hardware accelerated in Java 5 but not in Java 6 for some reason.
Offline keldon85

Senior Member


Medals: 1



« Reply #5 - Posted 2007-07-31 01:30:43 »

I am mostly drawing png's.
I mean the way you are creating the images, etc. What is your approach? I.e. do you just create a buffered image?

Offline Linuxhippy

Senior Member


Medals: 1


Java games rock!


« Reply #6 - Posted 2007-09-01 20:33:45 »

could you run your game with java5 and java6 using the following command-line-switch:
1  
-Dsun.java2d,trace=count


and post the output here?

lg Clemens
Offline CommanderKeith
« Reply #7 - Posted 2007-09-02 16:40:13 »

Maybe the cause of the difference you see between java 5 and 6 swing performance is the 'gray-rect' fix which stops components' backgrounds from flashing over the screen? 

This may cause less rendering to the screen , making things faster.  It certainly looks as though there is less rendered since there's no gray-rect flash every time a window is made visible.  But I don't know for sure  Tongue.

Check this out for details: http://weblogs.java.net/blog/zixle/archive/2005/04/no_more_gray_re_1.html

Offline Abuse

JGO Coder


Medals: 2


falling into the abyss of reality


« Reply #8 - Posted 2007-09-03 01:04:07 »

That 'fix' for the grey rect. issue smells distinctly like yet another swing hack fix  Roll Eyes

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here!
Offline Linuxhippy

Senior Member


Medals: 1


Java games rock!


« Reply #9 - Posted 2007-09-03 22:56:55 »

That 'fix' for the grey rect. issue smells distinctly like yet another swing hack fix  Roll Eyes
Why do you think so?
I can't see what's wrong with using something which is already stored in an image and repaint it again instead of clearing the image, runing a lot of code to draw the same stuff into the image again and blit that.

In fact this is also the way Windows (well at least till XP) handled its drawing, and Windows its known to perform quite well when it comes to perceived performance of common-controls-based desktop apps.

lg Clemens
Games published by our own members! Check 'em out!
Play the free demo of Revenge of the Titans!
Offline erikd

JGO Knight


Medals: 3
Projects: 3


Maximumisness


« Reply #10 - Posted 2007-09-04 11:26:35 »

Quote
Maybe the cause of the difference you see between java 5 and 6 swing performance is the 'gray-rect' fix which stops components' backgrounds from flashing over the screen?

This may cause less rendering to the screen , making things faster.  It certainly looks as though there is less rendered since there's no gray-rect flash every time a window is made visible.

Isn't the OP's problem the other way around, java6 rendering performance being degraded compared to java5?

Offline Linuxhippy

Senior Member


Medals: 1


Java games rock!


« Reply #11 - Posted 2007-09-04 14:26:00 »

das that the author does not reply anymore :-/
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!
 
Get high quality music tracks 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 (34 views)
2013-05-17 21:29:12

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

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

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

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

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

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

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

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

UnluckyDevil (149 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.109 seconds with 21 queries.