Well as you probably already concluded, there are many ways do to this with just SDL.

Barring 3rd party article engine, [size=9px](do any Pascal ones exist for SDL?)[/size] you can create a rather simple one from scratch.

You'll need to become familiar with alpha masking your texture data and your blit functions OR an alphadraw function like what is offered in sdlutils [size=9px](JEDI-SDL specific)[/size]. That is about it as far as SDL is concerned...

Provided you have the physics down, it shouldn't be a problem for you...

Creating an alpha mask is rather simple if you understand the concept of RGB pixel data. R, G and B are channels. A is the channel for Alpha. [size=9px](or transparency)[/size] RGB channels control the color and A controls the transparency. All in hardware! [size=9px](provided your card supports this)[/size]

Your data will normally either look like; [ARGB] or [RGBA]. Each letter shown being a byte out of the 32-bit texture pixel.

Great, now how do you alter this? Well SDL as you may have guessed has such functions... just look 'em up in the sdl header. [size=9px](if you are using JEDI-SDL's headers then it's easy to find and all grouped with the graphics/video functions)[/size]

And how does this help me create particles? Easy... particles fade out after a specific time, right?

Now you want to make a texture to use for the particles. Well you can do this in a few different ways. Create a series of frames each with it's own animation frame and alpha level and place that into a texture OR just create one particle frame and change the alpha level in the texture each time you draw. The latter could be a bit cumbersome depending on the system CPU juice available, other things going on graphics-wise and how big your particles are. It's a balance you have to determin yourself. But with ever increasingly faster cards and processors, this may be a moot point soon enough.

Once you have just picked one of these and provided that you've set the alpha channels in your texture properly... it should be rather easy to setup the drawing portion of your physics engine.


Sorry, no code to show right now. Too much else going on. :?