Jump to content
  • Advertisement
Sign in to follow this  
konnichiwa

DirectDraw Translucent Surface??

This topic is 5145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!