Hey everyone, I have a quick question. In my book (yes, this is becoming familiar to all of you! ), this is the code it has for flipping a complex surface:
I have two problems with this code (it works fine, my problems are just due to my excessively picky nature).Code:while(surface->Flip(NULL, DDFLIP_WAIT) != DD_OK);
#1: In the DirectX 7 docs, it says that DDFLIP_WAIT is set by default; thus, theoretically I could replace it with 0 and it would work just as well, and I would cut down the size of my source file by 10 bytes. Am I correct?
#2: In the docs, it says that if DDFLIP_WAIT is set, "The method does not return until the flipping operation has been successfully set up or another error, such as DDERR_SURFACEBUSY, is returned." Under DDERR_SURFACEBUSY, it says "Access to the surface is refused because the surface is locked by another thread." Is this why there is a while loop? To keep trying until the other thread unlocks the surface?
#3: On MSDN, it said somewhere (I think in the FAQ) that the proper method to check whether or not a call failed was to use the macro FAILED(). Does it matter in this case?Code:while(FAILED(surface->Flip(NULL, DDFLIP_WAIT)));