0
\$\begingroup\$

I have a problem with libgdx, fullscreen and what I believe is screen tearing or any other sort of artifact.

In windowed mode, everything works fine, but when i switch to fullscreen, moving sprites create some sort of screen tearing effect:

screen tearing on player character

Had to take a photo with my phone, because using the print button does not work in fullscreen, and I could not capture the screen tearing effect using a libgdx "TakeScreenshot" Function.

I am using a TexturePacker and I tried changing the Filtering (Nearest, Linear) as well as edgePadding and duplicatePadding with no positive result.

I enabled vSync which also did not fix the problem.

Maybe anyone has encountered such a problem and can lend a helping hand.

Thanks in advance.

Edit:

This is how i enabled vSync:

LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.vSyncEnabled = true;
//some other config stuff
new LwjglApplication(new MyGame(), config);
\$\endgroup\$
2
  • \$\begingroup\$ Show us how you enable V-Sync \$\endgroup\$
    – Ocelot
    Commented Jul 6, 2019 at 11:23
  • \$\begingroup\$ Might be a driver setting on your machine \$\endgroup\$
    – Ocelot
    Commented Jul 6, 2019 at 12:10

1 Answer 1

0
\$\begingroup\$

I figured it out. Following Ocelots hint, I checked whether my framerate was really running at my monitors refresh rate, which it did not (so vSync was disabled).

Somehow the LwjglApplicationConfiguration applies all the settings I hand over, except for vsync. Not really sure why.

I fixed the whole thing with a

Gdx.graphics.setVsync(true);

call in the core project.

This correctly applies vSync and removes any artifacts or jittering.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .