• Advertisement


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

Brainstorming DxDraw Conversion - Very usefull

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

A lot of other people and myself need tu be able to blit only a part of surface. That part is decribed by an array of points, forming a region. Now the normal (CDX wrapped) function for bliting transparently is this. Question: how to convert it so it displays only the pixels in the region (i have the source for finding if a point is in the region). **** HRESULT CDXSurface::DrawTrans(CDXSurface* lpCDXS, LONG lDestX, LONG lDestY, RECT* srcRect) { HRESULT rval; RECT tRect; if(m_lpDDS == NULL) return -1; if(srcRect == NULL) { tRect.top = 0; tRect.left = 0; tRect.right = m_PixelWidth; tRect.bottom = m_PixelHeight; } else { tRect = *srcRect; } if (ValidateBlt(lpCDXS, &lDestX, &lDestY, &tRect) == FALSE) return 0; rval = lpCDXS->m_lpDDS->BltFast(lDestX, lDestY, m_lpDDS, &tRect, DDBLTFAST_WAIT | DDBLTFAST_SRCCOLORKEY); if(rval == DDERR_SURFACELOST) rval = Restore(); return rval; }

Share this post

Link to post
Share on other sites

  • Advertisement