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

Author Topic: Graphics/Window Scaling  (Read 3308 times)

0 Members and 1 Guest are viewing this topic.

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Graphics/Window Scaling
« on: May 03, 2010, 01:50:20 pm »
Hello, everybody :]

I have a question. I'd like to make little games with SFML as I start off which look like Atari and NES games of old. The only problem is that resolutions these days are much higher than those ancient resolutions, and as such it's hard to get the games to look as if they're from that era with so many pixels to operate on.

Is there a way I can work with the correct-resolutioned buffer behind the scenes (Atari, I believe, is 192 x 160) and then scale the final display image to something four times that size that I can play on my computer? I understand that if I play with 192 x 160 unscaled, it'll be tiny and virtually unplayable. There was some way this could be done with SDL, I believe, but I don't remember how it was done and how it would translate over to SFML.

I hope my question doesn't make me sound mentally incompetent, but I'm just beginning to get into games programming and there is much, much, much that I do not know and would like to learn from you kind people. :] Thank you very much for your time.

Colton
Whether you think you can or you can't, you're right.

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
Graphics/Window Scaling
« Reply #1 on: May 03, 2010, 02:28:13 pm »
Why not just scale your sprites in-game like many emulators do?

If you want it to look old all you have to do is set smoothing to false.

nulloid

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Graphics/Window Scaling
« Reply #2 on: May 03, 2010, 03:59:03 pm »
Make an sf::View, and set it's width and height 192 and 160. And sf::View will scale the graphic in it to the size of the window.

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Graphics/Window Scaling
« Reply #3 on: May 03, 2010, 08:24:19 pm »
Quote from: "Ashenwraith"
Why not just scale your sprites in-game like many emulators do?

If you want it to look old all you have to do is set smoothing to false.


The idea seems fairly simple, but what about for movement and other actions that must be scaled, as well?

Quote from: "nulloid"
Make an sf::View, and set it's width and height 192 and 160. And sf::View will scale the graphic in it to the size of the window.


That idea seems like it might work for what I'm aiming for. I'll try and implement something with that and I'll get back to this forum to let y'all know if it works.

Thanks to both of you for your help. :]
Whether you think you can or you can't, you're right.

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Graphics/Window Scaling
« Reply #4 on: May 03, 2010, 08:45:31 pm »
I got a good enough method working as of now with an sf::View. When drawing primitives, they still look virtually the same and not old, but that's okay for now. I'm sure with drawing sprites, it takes into account their scaling and makes them look as old as they need to look.

I appreciate the help, guys. :]
Whether you think you can or you can't, you're right.

nulloid

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Graphics/Window Scaling
« Reply #5 on: May 04, 2010, 01:23:39 am »
You are welcome ^_^