# How do I get antialiasing in LibGDX with the LWJGL3 backend?

Updated to the LWJGL3 backend for LibGDX to for controller connect / disconnect functionality and access to geometry shaders and I'd rather not go back. There used to be a "samples" field in the LWJGLApplicationConfiguration object for setting antialiasing, but it no longer exists in LWJGL3ApplicationConfiguration. (Oh, and I'm only targeting Desktop)

• Not sure what you're talking about, there is a samples field github.com/libgdx/libgdx/blob/master/backends/… Mar 17, 2017 at 21:11
• Ah, it does indeed exist but is package private, so can't be modified directly. Mar 17, 2017 at 21:29
• You shouldn't but you can. You even said the keyword, "package private". You can just create a wrapper and put it in the same package. You can also use reflection and stuff. Though in this case, there's a setter for it. Mar 17, 2017 at 21:45

Use setBackBufferConfig on the LWJGL3ApplicationConfig. The last parameter is the amount of samples.
public void setBackBufferConfig(int r, int g, int b, int a, int depth, int stencil, int samples)