Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (555)
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 4608 times)
0 Members and 1 Guest are viewing this topic.
Offline zappsweden

Junior Member




Java games rock!


« Posted 2007-07-30 20: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 20: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 20:31:34 »

I am mostly drawing png's.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline 2playgames

Junior Member





« Reply #3 - Posted 2007-07-30 20: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 21: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-30 23: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 18: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 14: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 Knight


Medals: 12


falling into the abyss of reality


« Reply #8 - Posted 2007-09-02 23: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! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline Linuxhippy

Senior Member


Medals: 1


Java games rock!


« Reply #9 - Posted 2007-09-03 20: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!
Legends of Yore - The Casual Retro Roguelike
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #10 - Posted 2007-09-04 09: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 12: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.

 

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

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (29 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (38 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (24 views)
2014-08-16 06:20:21

Tekkerue (34 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (48 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!