本文整理汇总了C++中LPDIRECTDRAWSURFACE7::BltFast方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTDRAWSURFACE7::BltFast方法的具体用法?C++ LPDIRECTDRAWSURFACE7::BltFast怎么用?C++ LPDIRECTDRAWSURFACE7::BltFast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTDRAWSURFACE7
的用法示例。
在下文中一共展示了LPDIRECTDRAWSURFACE7::BltFast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Blt
void CWnd::Blt(LPDIRECTDRAWSURFACE7 lpSurf)
{
if (childwindow)
{
childwindow->Blt(lpSurf);
return;
}
PreBlt();
RECT r={0,0,w,h};
lpSurf->BltFast(x,y,surf,&r,0);
}
示例2: Draw
void CCursor::Draw(LPDIRECTDRAWSURFACE7 lpSurf,const int w,const int h)const
{
//#define STRETCHCURSOR
if (lpSurface[curframe]==NULL)return;
if ((CursorPos.x<0)||(CursorPos.y<0)||(CursorPos.x>w)||(CursorPos.y>w))return;
const int hotspotx=10;
const int hotspoty=5;
#ifdef STRETCHCURSOR
const int cw=(width*w)/800;
const int ch=(height*h)/600;
RECT s={0,0,width,height};
RECT d={x,y,x+cw,y+ch};
if (d.right>w)
{
s.right-=((d.right-w)*800)/w;
d.right=w;
}
if (d.bottom>h)
{
s.bottom-=((d.bottom-h)*600)/h;
d.bottom=h;
}
lpSurf->Blt(&d,lpSurface[curframe],&s,DDBLT_WAIT|DDBLT_KEYSRC,NULL);
#else
RECT src={0,0,width,height};
int mx=CursorPos.x-hotspotx;
int my=CursorPos.y-hotspoty;
if (mx<0)
{
src.left-=mx;
mx=0;
}
if (my<0)
{
src.top-=my;
my=0;
}
if (mx+src.right>w)
src.right=w-mx;
if (my+src.bottom>h)
src.bottom=h-my;
lpSurf->BltFast(mx,my,lpSurface[curframe],&src,DDBLTFAST_SRCCOLORKEY);
#endif
}