Original Post
I am curently learning DirextX7 are saw this code in the SDK
HRESULT hRet;
while (TRUE)
{
hRet = g_pDDSBack->BltFast(0, 0, pdds, &rcRect, FALSE);
if (hRet == DD_OK)
break;
if (hRet == DDERR_SURFACELOST)
{
hRet = RestoreAll();
if (hRet != DD_OK)
break;
}
if (hRet != DDERR_WASSTILLDRAWING)
break;
}
I understand that if the blt is succesful then you break out of the while loop. But if the surface was lost and the restore is succesful then
if (hRet != DD_OK)
break;
will be false.
Then
if (hRet != DDERR_WASSTILLDRAWING)
break;
will be true and you will break out of the loop even though the surface was restored.
The SDK said that if the restore was succesful it would loop back up to the blt statement.
Did i understand this incorrectly? i would really appreciate some feedback.