SFML community forums
Help => Window => Topic started by: Phanoo on October 31, 2014, 01:04:20 pm
-
Hi
I have a SFML window, when i maximize it, the graphics are scaled to fit the screen with the nearest neighbor algorithm, which looks very bad when desktop resolution isnt a multiple of the window's native size.
Is there a way to force a better quality resampling? (like the one used for textures with smooth enabled?)
-
the graphics are scaled to fit the screen with the nearest neighbor algorithm
What graphics?
There are two things that you can smooth:
- textures, with bilinear filtering (see Texture::setSmooth)
- geometry, with anti-aliasing (see ContextSettings::antialiasingLevel when you create the window)
-
i'd like the whole screen to be anti-aliased when i maximize the window. just like when you resize a picture in photoshop/gimp.
Texture smoothing seems to do the job but the problem is that it breaks transparent color in textures (displays some artifacts...a bit of the transp color is displayed). I'd like to use the texture without smoothing, but to smooth the renderer (all render to the screen normally then resize and anti-alias the whole thing). Is it possible ?
I tried AA with contextSettings (value to 8 ) but it doesn't smooth, it seems it justs add some artifacts
-
Some easy solutions:
Create different assets for different resolutions. Or catch resize events and scale your assets yourself.
-
You can draw to a fixed-size sf::RenderTexture and draw it to the window smoothed with a sprite.
-
You can draw to a fixed-size sf::RenderTexture and draw it to the window smoothed with a sprite.
Thank you that did the job perfectly