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

Author Topic: Can SFML do.....  (Read 2598 times)

0 Members and 1 Guest are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Can SFML do.....
« on: May 11, 2011, 10:00:09 am »
Hi

I'm totally new here, and am looking at SFML to replace another so-called "simple" API. From the documentation, SFML looks fantastic.

The projects I work on have some quite specific requirements - and looking through the docs I'm not clear if it can do what I need, so here's hoping someone experienced can tell me :)

1. Drawing from large tiles: I use 2048x2048 PNGs which need to be loaded when the game starts, and then create images/sprites from those. Each game has around 500 graphical elements, so, that's a lot of file to load individually!

2. Scaling: We use different screen resolutions, from 1024x768 up to 1600x1050. Each frame needs to be created in a buffer, and then rendered at whatever size is necessary. Can SFML do this? Also what scaling algorithms does it have (it needs to be v. high quality - no blockiness).

3. Rendering: What rendering back-end does SFML use - I assume it's always OpenGL? This is related to point 2 really.

4. I assume SFML supports fullscreen and multiple windows (I think so if I read the docs right??).

I think that's it for now :) Looking forward to getting stuck in to some code!

Cheers
Ed
SFML 2.1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Can SFML do.....
« Reply #1 on: May 11, 2011, 10:07:49 am »
Hi and welcome :)

Quote
1. Drawing from large tiles: I use 2048x2048 PNGs which need to be loaded when the game starts, and then create images/sprites from those. Each game has around 500 graphical elements, so, that's a lot of file to load individually!

SFML uses hardware acceleration so there are some limitations, especially the maximum image size that the graphics card supports, and the available video memory.
500 * 2048x2048 images consumes 8GB, so all this stuff is unlikely to fit in your graphics card's memory.

Quote
2. Scaling: We use different screen resolutions, from 1024x768 up to 1600x1050. Each frame needs to be created in a buffer, and then rendered at whatever size is necessary. Can SFML do this? Also what scaling algorithms does it have (it needs to be v. high quality - no blockiness).

SFML doesn't perform scaling itself, it leaves this task to the GPU (which makes it almost free to execute).
Two algorithms are available: nearest pixel and bilinear filtering.

Quote
3. Rendering: What rendering back-end does SFML use - I assume it's always OpenGL? This is related to point 2 really.

Yep, OpenGL only.

Quote
4. I assume SFML supports fullscreen and multiple windows (I think so if I read the docs right??).

Absolutely.
Laurent Gomila - SFML developer

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Can SFML do.....
« Reply #2 on: May 11, 2011, 10:33:10 am »
Hi Laurent

Thanks for the quick reply!

Firstly, sorry, I mean there are 500 elements on the large PNG files (usually ~100 per file), so there are 5x 2048x2048 (not 500x :D) So that's good to hear this can be done. I don't want to load 500 individual small PNGs, this would take forever, and we have a restriction on loading time.

Regarding the scaling, it's good to hear the GPU does all the hard work. My guess is, since we can only use linear/nearest pixel is to do our graphics at the highest resolution we will use (1600x1050) and then scale down?

I have used OpenGL and scaling from 1024x768 to 1600x1050 looks horrible!!

Kind Regards
Ed
SFML 2.1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Can SFML do.....
« Reply #3 on: May 11, 2011, 10:41:54 am »
Quote
Regarding the scaling, it's good to hear the GPU does all the hard work. My guess is, since we can only use linear/nearest pixel is to do our graphics at the highest resolution we will use (1600x1050) and then scale down?

I'd say this is the best solution, but you should test to make sure it really is.

Quote
I have used OpenGL and scaling from 1024x768 to 1600x1050 looks horrible!!

Depends what texture filters you used ;)
Laurent Gomila - SFML developer

 

anything