简体   繁体   中英

DirectDraw Blt function parameters

Just a simple blt function:

RECT dstRect = {dstL, dstT, dstR, dstB};
RECT srcRect = {srcL, srcT, srcR, srcB};

HRESULT hr = _surface->Blt(&dstRect,source,&srcRect,DDBLT_WAIT, NULL);

My question is:

let's say I have a buffer of width 'w', I specify dstL = 0. What should be dstR ? w or w-1 ?

meaning is dstR included or not ? (< or <=) ?

DirectDraw rectangles are like GDI rectangles in that they cover the area up to (but not including) the right column and bottom row. So it should be w.

Reference: http://msdn.microsoft.com/en-us/library/aa911080.aspx :

The RECT structures are defined so that the right and bottom members are exclusive: right minus left equals the width of the rectangle, not one less than the width.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM