Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Upscaling pixel graphics: Force nearest neighbor method  (Read 2942 times)

0 Members and 1 Guest are viewing this topic.

sgehlich

  • Newbie
  • *
  • Posts: 6
    • View Profile
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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
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).
Laurent Gomila - SFML developer