Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've been working on a game in c++ for about a week and a half, and I've been using SDL. However, my current engine only needs the following from whatever library I use:

  • enable double buffering
  • load an image from path into something that I can apply to the screen
  • apply an image to the screen with a certain x,y
  • enable transparency on an image
  • (possibly) image clipping, for sprite sheets.

I am fairly sure that SFML has all of this functionality, I'm just not positive. Will someone confirm my suspicions?

Also I have one or two questions regarding SFML itself. Do I have to do anything to enable hardware accelerated rendering? How quick is SFML at blending alpha values?

share|improve this question
add comment

5 Answers

up vote 10 down vote accepted

I haven't used SDL, and very little SFML, but the consensus I get is SFML is like SDL, but hardware accelerated and object-oriented.

A quick google of your points gave me the following:

  • enable double buffering
  • load an image from path into something that I can apply to the screen
  • apply an image to the screen with a certain x,y
  • enable transparency on an image
  • (possibly) image clipping, for sprite sheets.
share|improve this answer
add comment

I think, SFML is library, which gives you power to use OpenGL. So hardware rendering is self-evidence. And it's fast with blending - you can write your own shader and do blending by yourself.

I also think, double buffering is enabled in default in SFML.

Apply image to screen can be done by drawing a rectangle with texture ;)

Transparency can be also enabled (blending).

I don't have experience with SFML and images, so I don't know nothing about this second. And I don't understand the last point (image clipping).

share|improve this answer
    
Thanks for the response! I appreciate it. –  ultifinitus Mar 19 '11 at 0:53
add comment

SFML has all those features you listed I believe. SFML is more object-oriented, while SDL is C-style. SFML does have some extra functions like rotating images, and I think scaling them.

Now, this is just an educated guess, but I've heard of hardware surfaces and hardware accelerated surfaces, but reading this article: http://linuxdevcenter.com/pub/a/linux/2003/08/07/sdl_anim.html, it seems that if the two terms mean the same thing, then SFML may not really have an advantage over SDL in terms of blitting speed or blending alpha values.

share|improve this answer
1  
No, SDL's 'hardware surfaces' are an older construct that don't use the modern 3D accelerated pipeline. –  Kylotan Mar 20 '11 at 0:13
add comment

SFML does all of those things, yes. As you are coding in C++, I think you'll find SFML a pleasure to work with as it is very OO and, imho, much tidier to integrate into your code.

I highly recommend going for the switch.

EDIT: SFML is hardware accelerated. SDL is not.

share|improve this answer
    
This is more of a comment since it's mostly just an opinion. –  Byte56 Nov 10 '12 at 15:53
    
@Bytes56 - fair enough, but (1) I can't comment due to not enough rep, and (2) I answered the question by stating that, yes, SFML does all of those things. Should I be marked down for the additional opinions? I guess that's up to you. –  miklatov Jan 17 '13 at 15:38
add comment

SDL and SFML are both hardware accelerated. I would suggest though to start learning stuff like DirectX or OpenGL and try to use that even for 2D graphics. It will benefit you much more than wasting time with obscure libraries like SDL and SFML.

share|improve this answer
3  
SDL is neither obscure nor hardware accelerated. –  user744 Oct 15 '11 at 21:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.