Difference between libGDX and Swing And Java

Hi Forum!
Im about to finish my college project, my game Archer Hunter!

I need some information for the presentation… I need help!

Can you guys help me?

Whats the difference between Java Thread and libGDX Thread?
I know that sleep() of java is a bit annoying and that libGDX is more stable.
Although i saw java games that are able to stabilize the FPS… So whats the difference?

Does Java swing threads for rendering is faster and occupy less memory than a same view using libGDX?

Thanks in Advance fellas!

#With libgdx thread , i mean libgdx Rendering Thread

Not sure what you are asking but here we go :slight_smile:

Maybe I am wrong or get your question wrong but I am quite sure that there is no libgdx thread. They extend it sometimes but there is no other “default” thread that extends object direktly.
You can look up the diffrent Object <- Thread <- SomeLibgdxThread in the docs. For example: http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/utils/PauseableThread.html

I think that you are talking about the main-loop. sleep(1) -> thread sleeps at last 1 ms.
It depends on the main-loop: http://www.java-gaming.org/index.php?topic=24220.0

Dont think that the event-threads of swing can be compared to libgdx mainthread. Indeed Libgdx memory usage depends on the type of the libgdx app (desktop, android, ios, html)
Libgdx offers you opengl support so it will be faster if you use it (in the way it should be used).

Oh Ok!

A) Does the libGDX thread do any magic calculus to sleep() ?

B)If we get a View called A and we code it on swing and on libgdx, for instance,

A has a table of users and 2 buttons.

What will cost less resources ( CPU + Memory ) ?

Don’t worry about performance before you understand the fundamentals.

Absolutely agreed.

Even if you do want to worry about “performance”, there are many ways to measure that: what will be easier to develop for? What will be easier to port to other platforms?

If you know Swing and just want to create a quick project, then use Swing.

If you don’t know anything, use Processing until you’re more familiar with the basics.

Everybody else should use libGDX.

You re missing the point.

I actually need this information in case someone ask in my presentation.

A libGDX thread is just a Java thread.

The abstraction you are talking about that makes “libGDX threads” have a more accurate sleep time is found here:

sync method in this java file

edit-
written by our own Riven and kappaOne so they could probably elaborate with much more knowledge on it than I can.