I am planning on putting alpha blending into a 2d game i am making. I know that DDraw doesn''t support it so I did it in software. Except how am I supposed to make alpha values for my surfaces? Are there any image editors where you can edit the alpha values? should i have seperate buffers with my alpha values in them? Another thing that I noticed as I browsed the DirectX SDK help was that the overlay surface has a bunch of alpha flags and stuff.. do overlays support alpha transparency? if so, do most video cards support overlay surfaces capable of this?
Any help would be appreciated,
The way I did it, was something like this: I started working in 32 bit format, filled the first 8 bits for alpha,and used my routine to do the blending, then I switched to 16 bit (for speed) and had to use a buffer alpha To get the alpha, though, I use my own 32 bit image format, wich i build from 2 24 bit bitmaps, where one bitmap has the image info, and the blue component of the second gets to be the alpha. When using 16 bits, i just convert the file values to 16 bit and channel the alpha info into the buffer.
You can use wichever color you well please (i don''t even remember why I picked blue, actually I just needed 8 bits for alpha) but if you use just one of the colors you can even paint your "alpha mask" in grey without much fuss. As for identifing the the budffer with the image, I have a class for storing the dd surfaces, so I just added the buffer to the class, and instead of manipulating dd surfaces I just move the class around. A struct with a LPDDSURFACE and a BYTE * or whatever will do fine.