• Advertisement

Archived

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

DirectDraw 6 Color Keying + Clipping

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

Hello all, I''m making a Tetris-clone in DirectDraw 6, and I wanted to know, is it possible to create a clipper attached to an off-screen VRAM surface? I keep trying but to no avail - I want to draw the Tetris shapes on a seperate matrix surface but have it clip whatever is not on the surface (i.e. when a new block first appears). Also, is it possible to declare source color keying on the back buffer (when using buffer flipping). What i''m trying to do is have a skin surface, the size of the screen, that is drawn around the main playing matrix(where the blocks move and tetris occurs), so that the transperancy colour is included when the skin picture is copied onto the skin surface, but when I blit the surface to the back buffer, the chosen colour does not get blitted, leaving the playing area visible. Do you get what I mean? If not, ask, but I''d appreciate whatever help I could get, or if anyone else can think of a better way to do the main game window (outside of where the action occurs). "Cause I''''m a creep.. I''''m a wierdo.." - Radiohead

Share this post


Link to post
Share on other sites
Advertisement
DirectDraw7 allows you to specify a color for transparency when you create your surface. You just call blt or bltfast with the right flag afterwards and that''s that: you''ve acheived transparent blitting.

I''m not sure what DD6 would support, but I''d assume it wouldn''t be too different from 7 in terms of basic features such as this. Have a look at your docs and look into the blt and bltfast functions, you should be able to find an answer. If not, then migrate to DirectDraw 7

Share this post


Link to post
Share on other sites
Hey, thanks for the reply. I just got it working (it was late last night when I posted and easy things elude me when I''m tired/stupid), but thank you very much for the post - I''ll be moving to directx 9 after I finish this little game, so I''m skipping right by 7

But the direct draw clipping problem still remains unanswered, for anyone who would want to a guess as to how I could do that? : )

Share this post


Link to post
Share on other sites
You can attach a clipper to the back buffer just like the frontbuffer BUT you cannot use BltFast. BltFast doesn''t work with a clipper attached to the surface. I think there was an article somewhere that talked about BltFast not being any faster than Blt but I could be mistaken. Hope that helped.


Evillive2
E-Mail

Share this post


Link to post
Share on other sites

  • Advertisement