Skip to main content
gamedev.net
🔒 Locked

DirectDraw Translucent Surface??

Started by konnichiwa 0 replies 950+ views
Original Post
konnichiwa
konnichiwa
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!
Agony
Agony
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.
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas nly, and not for things themselves." - John Locke o

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.