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 (407)
games submitted by our members
Games in WIP (293)
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  
  Speed in Java applet viewer vs browser  (Read 270 times)
0 Members and 1 Guest are viewing this topic.
Offline doos

Senior Member


Medals: 2
Projects: 2


Here be random


« Posted 2013-02-20 23:48:53 »

During development, I've been testing my applet from eclipse, and that's using applet viewer (javaw). It runs smoothly, and is a beauty to behold. In a browser, it runs jerkily and is unresponsive.

Admittedly, I've added a bunch of stupid effects lately and increased the screen size, so I could understand why it was slow.. If it was slow in applet viewer as well as the browser window!

Is there anything I can do to make it run ok in the browser, rather than paring down the code or making it more efficient?
Offline jonjava

JGO Knight


Medals: 33



« Reply #1 - Posted 2013-02-21 12:04:27 »

Well, no.

Either there's a bug that makes it slow or your code and or how you've done it is making it slow. It also depends on what you're using, basic java and java2d or LWJGL or LibGDX.

If the things that you're doing (effects or whatever) are being done smoothly by other similar applets then you might consider why that is and how you could make your code more efficient.

Using OpenGL libraries like LWJGL, LibGDX or JOGL allows you to take advantage of the graphics card and make rendering a lot faster. This comes with a longer loading speed (loading speed doesn't really matter anyway) and more disciplined rendering/programming practices.

Short answer:
Quote
Is there anything I can do to make it run ok in the browser, rather than paring down the code or making it more efficient?

No.

Online Riven
« League of Dukes »

JGO Overlord


Medals: 438
Projects: 4


Hand over your head.


« Reply #2 - Posted 2013-02-23 20:51:23 »

In java2d you may run in the problem that a different rendering backend is picked. You have minimal control over this with configurable vm parameters.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Games published by our own members! Check 'em out!
Try the Free Demo of Titan Attacks
Offline doos

Senior Member


Medals: 2
Projects: 2


Here be random


« Reply #3 - Posted 2013-02-26 00:17:32 »

Thanks for the answers.. Reading more on different parameters that can be set.. Specifically http://www.java-gaming.org/topics/sun-java2d-opengl-true-in-applet-with-bufferstrategy/25988/view.html
Pages: [1]
  ignore  |  Print  
 
 

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 (97 views)
2013-05-17 21:29:12

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

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

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

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

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

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

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

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

UnluckyDevil (201 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.08 seconds with 21 queries.