Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


CopyRects with alpha

This topic is 5814 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

In an attempt to use the back buffer for texturing, I am currently copying the back buffer into a texture surface using the CopyRects() method. The back buffer and the texture surface both have the same format and so this works great for most modes. But when I try using D3DFMT_A8R8G8B8 mode it slows my game to a crawl! I can use D3DFMT_X8R8G8B8 and it hardly slows the game down at all, but I really need the alpha channel in the texture to be valid. I''m just wondering why this is so slow? My only thought is that the alpha buffer may be stored seperatly from the color buffer so it actually has to do the copy from two different sources? At any rate I''ll probably end up rendering the scene directly to a texture instead, but I would like to have the peace of mind of knowing why it''s so slow before I completely abandon this idea.

Share this post

Link to post
Share on other sites
I wish I had an answer for you, but I''m making Breakout right now and I use CopyRects to copy an image surface with the stage background on it to the back buffer, and it slows my app down tremendously.

I have read on this board about the slowness of CopyRects. That''s probably the source of your problem. I''m going to be searching for a work around for that here pretty soon to speed my app up some. Just thought I''d let you know what I THINK it is. I''m still pretty new at this myself. (Well, I''ve been at it for 2 years, but I''ve been skipping too much, and well, I haven''t got anywhere. I finally am making some real progress.)

Much greatness is achieved thru perseverance and faith.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!