Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Upscaling pixel graphics: Force nearest neighbor method
Print
Pages: [
1
]
Author
Topic: Upscaling pixel graphics: Force nearest neighbor method (Read 2937 times)
0 Members and 1 Guest are viewing this topic.
sgehlich
Newbie
Posts: 6
Upscaling pixel graphics: Force nearest neighbor method
«
on:
February 24, 2013, 10:37:00 am »
Hey,
right now I'm working on a 2D game in pixel style which has been designed for 400x300 pixels. Right now I'm scaling up all images to the actual screen size (right now that's 800x600), but SFML seems to automatically use bicubic or bilinear for resampling the image.
Is there a way to force SFML to just repeat the pixels so that it preserves the pixel style?
Here's the current code for my drawing:
https://gist.github.com/saschagehlich/ea934f7829b3055e47fe
Thanks,
Sascha
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Upscaling pixel graphics: Force nearest neighbor method
«
Reply #1 on:
February 24, 2013, 12:06:42 pm »
Nearest neighbour is the default filter in SFML 2. You get linear filtering only if you call
texture.setSmooth(true)
.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Upscaling pixel graphics: Force nearest neighbor method
anything