コード例 #1
0
void updateFrameWin()
{
    RECT                rcRect;
    RECT                destRect;
    HRESULT             ddrval;
	POINT				pt;

    GetClientRect(hwnd,&destRect);

    pt.x=pt.y=0;
    ClientToScreen(hwnd,&pt);
    OffsetRect(&destRect,pt.x,pt.y);
   //////////////////////////////////////////////////////////////
   // 두개의 페이지 전환이 이루어 지는 곳 
   // Blt() 함수가 실제로 비트맵을 그리는 함수

	rcRect.left   = 0;
	rcRect.right  = smScreenWidth;
	rcRect.top    = 0;
	rcRect.bottom = smScreenHeight;



	while(1)
	{
		ddrval=lpDDSPrimary->Blt(&destRect,lpDDSBack,&rcRect,NULL,NULL);
		if(ddrval == DD_OK) break;
		if(ddrval == DDERR_SURFACELOST)
		{
	//		ddrval = restoreAll();
			if(ddrval != DD_OK)	return;
		}
		if(ddrval != DDERR_WASSTILLDRAWING) break;

	}

} 
コード例 #2
0
void updateFrameWin_Video()
{
	RECT                rcRect;
    RECT                rcRect1;
	RECT                rcRect2;
	RECT                rcRect3;
	RECT                rcRect4;

    RECT                destRect;
	RECT                destRect1;
	RECT                destRect2;
	RECT                destRect3;
	RECT                destRect4;
    HRESULT             ddrval;
	POINT				pt;

    GetClientRect(hwnd,&destRect);

    pt.x=pt.y=0;
    ClientToScreen(hwnd,&pt);
    OffsetRect(&destRect,pt.x,pt.y);


   //////////////////////////////////////////////////////////////
   // 두개의 페이지 전환이 이루어 지는 곳 
   // Blt() 함수가 실제로 비트맵을 그리는 함수

	rcRect.left   = 0;
	rcRect.right  = smScreenWidth;
	rcRect.top    = 0;
	rcRect.bottom = smScreenHeight;

	destRect1.left	= 0;
	destRect1.right	= smScreenWidth;
	destRect1.top	= 0;
	destRect1.bottom = ParkPlayRect.top;

	destRect2.left	= 0;
	destRect2.right	= ParkPlayRect.left;
	destRect2.top	= ParkPlayRect.top;
	destRect2.bottom = ParkPlayRect.bottom;

	destRect3.left	= ParkPlayRect.right;
	destRect3.right	= smScreenWidth;
	destRect3.top	= ParkPlayRect.top;
	destRect3.bottom = ParkPlayRect.bottom;

	destRect4.left	= 0;
	destRect4.right	= smScreenWidth;
	destRect4.top	= ParkPlayRect.bottom;
	destRect4.bottom = smScreenHeight;


	rcRect1.left   = 0;
	rcRect1.right  = smScreenWidth;
	rcRect1.top    = 0;
	rcRect1.bottom = ParkPlayRect.top;


	rcRect2.left   = 0;
	rcRect2.right  = ParkPlayRect.left;
	rcRect2.top    = ParkPlayRect.top;
	rcRect2.bottom = ParkPlayRect.bottom;


	rcRect3.left   = ParkPlayRect.right;
	rcRect3.right  = smScreenWidth;
	rcRect3.top    = ParkPlayRect.top;
	rcRect3.bottom = ParkPlayRect.bottom;

	rcRect4.left   = 0;
	rcRect4.right  = smScreenWidth;
	rcRect4.top    = ParkPlayRect.bottom;
	rcRect4.bottom = smScreenHeight;


	while(1)
	{
		//ddrval=lpDDSPrimary->Blt(&destRect,lpDDSBack,&rcRect,NULL,NULL);
		ddrval=lpDDSPrimary->Blt(&destRect1,lpDDSBack,&rcRect1,NULL,NULL);
		ddrval=lpDDSPrimary->Blt(&destRect2,lpDDSBack,&rcRect2,NULL,NULL);
		ddrval=lpDDSPrimary->Blt(&destRect3,lpDDSBack,&rcRect3,NULL,NULL);
		ddrval=lpDDSPrimary->Blt(&destRect4,lpDDSBack,&rcRect4,NULL,NULL);
		if(ddrval == DD_OK) break;
		if(ddrval == DDERR_SURFACELOST)
		{
	//		ddrval = restoreAll();
			if(ddrval != DD_OK)	return;
		}
		if(ddrval != DDERR_WASSTILLDRAWING) break;

	}

}