SDL made sense back when 2D drawing was hardware accelerated. Nowadays you get better performance with 3D libs like OpenGL (which SFML uses). |
Mythios wrote: |
---|
SDL 1.3 Doesn't look to bad so far. Doesn't it have support now for the Nintendo DS as well? I thought SDL was still being actively developed? |
helios wrote: |
---|
However, one of the most common effects I needed -- a fade-in/out effect that gradually in/decreases the alpha of a surface -- was significantly slower. I don't know, maybe I was using the interface wrong (it wouldn't surprise me. It was my first time using OGL), but I don't think applying opacity to a whole texture 256 times should take over two seconds. |
OGL also doesn't simplify alpha blending at all, which my code used heavily. If you're using sprites that use a single bit for alpha, OGL can do the redrawing for you, otherwise you have to tell it each time the order you want the textures to displayed in. |
Modifying textures (if that's what you were doing) is slow. It's generally not what you want to do unless it can be avoided. |
For fade in / fade out effects, what I'd do is just draw a single untextured black quad over the entire rendered screen (or whatever portion of it you want faded out). The alpha of the black quad determines the level of the fade. |
2) You have to draw things in "bottom up" order in order for it to be drawn as you expect (but this would be true of any library) |
What if I want to fade out a single polygon in many? |
Exactly what I meant. If I'm doing exactly the same I was doing with SDL, that's not a simplification. What am I giving it Z coordinates for, then, if I also have to tell it how to render polygons in the proper order? |
For just a single polygon, it's probably easiest to just change the color for that polygon with glColor. |
|
|
EDIT: I just timed it. 3.382 s. |
Couldn't it just be implemented as a dependency graph? A depends on B which depends on C. |
You must be vsyncing. Rendering 256 frames at 75 Hz would take about 3.382 seconds. Rendering a single quad like you're doing would be lightning fast. |
You could make the assumption that all the polygons are on parallel or equal planes. |