Sign in to follow this  
konnichiwa

DirectDraw Translucent Surface??

Recommended Posts

I'm trying to create a translucent surface in my DirectDraw application. I've already got Transparacy done (With DrawFastFlags.SourceColorKey) but i have no idea how to go about Translucncy, and i cant find any examples on the net, if anyone can help please do! Cheers!

Share this post


Link to post
Share on other sites
I've never done DirectDraw myself, but I think I recall seeing mentioned multiple times that DirectDraw does not have any automatical alpha blending. You have to do it manually. Get access to the back buffer and the surface you want to draw, and manually calculate what the new pixels need to be by blending each pixel from the surface with each corresponding pixel on the back buffer. And I'm guessing that this can get slow if you do a lot of it.

Since you need it quickly, I believe this is your best shot. However, in later projects, you might consider moving to 3D APIs (Direct3D, er, DirectGraphics 8 and up, I mean; OpenGL, etcetera) for 2D games. You get access to really easy effects such as translucency, lighting, rotations and scaling, fancy effects such as pixel shaders, plus it's hardware accelerated, which DirectDraw isn't really, anymore (not that it really requires acceleration). It'll take a bit more learning, but many people here think it is definitely worth it, and I thoroughly agree.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this