Implemented vsync in windows port

This commit is contained in:
pagefault
2001-05-27 20:24:36 +00:00
parent 055172f128
commit 7e485903d5
6 changed files with 67 additions and 82 deletions

View File

@@ -145,10 +145,19 @@ void DDrawError(){
MessageBox (NULL, message1, "DirectDraw Error" , MB_ICONERROR );
}
extern "C" BYTE vsyncon;
void DrawScreen()
{
if(DD_CFB==NULL) return;
if(DD_Primary->Blt(&rcWindow,DD_CFB,NULL,DDBLT_WAIT,NULL)!=DD_OK)
if (vsyncon == 1)
{
if (lpDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, NULL) != DD_OK)
{
DDrawError();
}
}
if(DD_Primary->Blt(&rcWindow,DD_CFB,NULL,DDBLT_WAIT,NULL) != DD_OK)
{
DDrawError();
}