nothing while waiting. actually I am using double buffer to receive pictures from a camera. Its sdk posts an event when a picture finishes to be sent to a buffer.
the working loop is like this:
Qt Code:
  1. for (int k = 0; k<8; k++)
  2. {
  3. //double buffer
  4. ready=WaitForMultipleObjects(2,hEvents,false,2000);
  5. if (ready==WAIT_OBJECT_0)
  6. {
  7. PCO_AddBufferEx(hCam,0,0,sBufNr1, xRes, yRes, 0x000e);
  8. for (int l = 0; l<xRes * yRes; l++)bitMap[l+mapOffset] = data1[l];
  9. Update();
  10. }
  11. else
  12. {
  13. if(ready==(WAIT_OBJECT_0+1))
  14. {
  15. PCO_AddBufferEx(hCam,0,0,sBufNr2, xRes, yRes, 0x000e);
  16. SetPort(false);
  17. for (int l = 0; l<xRes * yRes; l++)bitMap[l+mapOffset] = data2[l];
  18. Update();
  19. }
  20. else{
  21. PCO_SetRecordingState(hCam,0);
  22. abort = true;
  23. }
  24. }
  25. }
To copy to clipboard, switch view to plain text mode