Archived

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

El Duderino

Transparency problem DirectDraw

Recommended Posts

Hail Dx Gurus, I am having woes with fastblit transparency. Here's the code :
    

// Attempt here to create "black", colour value 0, as transparent


DDCOLORKEY ckey;
	ckey.dwColorSpaceLowValue = 0;
	ckey.dwColorSpaceHighValue = 0;
	if (FAILED(lpDDSBackBuffer->SetColorKey(DDCKEY_SRCBLT, &ckey)))
	{
	return 1;
	}

// This is my experimental block


lpDDSBackBuffer->BltFast(0, 0, background, NULL, DDBLTFAST_WAIT); // | DDBLTFAST_SRCCOLORKEY);

lpDDSBackBuffer->BltFast(124, 0, background, NULL, DDBLTFAST_WAIT | DDBLTFAST_SRCCOLORKEY);
lpDDSBackBuffer->BltFast(62, 31, background, NULL, DDBLTFAST_WAIT | DDBLTFAST_SRCCOLORKEY);

lpDDSPrimary->Flip(0, DDFLIP_WAIT);

  
My first BltFast places my tile up in the left hand upper corner. Everything's groovy. But the two subsequent BltFasts, which are *supposed* to be only not blitting the black pixels, are not blitting any pixels at all. If I rip out the DDBLTFAST_SRCCOLORKEY part they blit happily but of course, no transparency. I cut what I thought to be the relevant bit only, I hope I didn't cut too little. Thanks for looking El Duderino Edited by - El Duderino on January 29, 2001 9:03:36 AM

Share this post


Link to post
Share on other sites
Hmmm... I don''t think the error is the blitting.
When I blit a picture without a colorkey using SRCCOLORKEY
it doesn''t show.

/MindWipe

"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."

Share this post


Link to post
Share on other sites
I read every similar post before returning here - every one of them, and none of them answered my question, even though this is a common one.

Thanks Coaster Kev and Mindwipe you have totally fixed things, it''s looking gorgeously transparent now !!!



El Duderino

Share this post


Link to post
Share on other sites