I'm using LibGDX to develop/render my game and when I start the game in windowed mode, then switch to full screen, the sprites look blurry. Importantly(?), starting the game in full screen then switching to windowed mode doesn't have this problem.
Here's a section of a screenshot starting off windowed:
And after switching to fullscreen, the (roughly) same section of the screen:
The sprites are loaded from a TextureAtlas
using LibGDX's TexturePacker
. They're rendered using a normal SpriteBatch
with the default settings/shaders.
These are my pack.json
settings:
{
"pot": true,
"paddingX": 2,
"paddingY": 2,
"bleed": true,
"edgePadding": true,
"maxWidth": 4096,
"maxHeight": 4096,
"duplicatePadding": false,
"filterMin": "MipMapLinearLinear",
"filterMag": "Linear"
}
I wondered if the filterMin/Mag might be having some effect but trying different settings is giving the same results.
To switch between fullscreen and windowed, I'm using the following code:
public static void toggleFullscreen() {
if (DisplaySettings.isGamefullscreen && Gdx.graphics.supportsDisplayModeChange()) {
// Switch to windowed
Gdx.graphics.setWindowedMode(DisplaySettings.windowedWidth, DisplaySettings.windowedHeight);
DisplaySettings.isGamefullscreen = false;
} else if (Gdx.graphics.supportsDisplayModeChange()) {
// Switch to full screen
Gdx.graphics.setWindowedMode(DisplaySettings.desktopWidth, DisplaySettings.desktopHeight);
Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
DisplaySettings.isGamefullscreen = true;
}
}
So in this case the game starts off windowed then toggles to fullscreen after everything has loaded/been set up.
I am using some FrameBuffer
s and TextureRegion
s to draw to, but these are disposed and recreated on a resize.
I feel like there's some problems perhaps with the mipmaps being created and used incorrectly in this case but I'm a bit stuck at this point, any help much appreciated!