DirectDraw 6 Color Keying + Clipping

Started by
2 comments, last by darkm00n 20 years, 1 month ago
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
"Cause I''m a creep.. I''m a wierdo.."- Radiohead
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
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? : )
"Cause I''m a creep.. I''m a wierdo.."- Radiohead
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
Evillive2

This topic is closed to new replies.

Advertisement