DDraw Lock();
I''m experiencing a very strange problem here...
I''m doing a alpha blending function to DDraw, but when I try to lock my surface, my app simply freezes.
I''ve debugged it and I found the error was in the Lock command line.
I''ve also zeroed the DDSURFACECAPS2 and put the dwSize to sizeof(ddscaps);
below is the piece of code that is making my program freeze:
ZeroMemory(&srcDesc, sizeof(srcDesc));
srcDesc.dwSize = sizeof(srcDesc);
srcDDS->Lock(NULL, &srcDesc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, NULL);
Any ideas why I get a crash???
Thanks!
-LordAsm-
If you use the DDLOCK_DONOTWAIT flag you can retrieve error codes, although I cannot see any problem with the code above. I''d guess your problem is where you actualy write to memory, have you tried just using lock then unlock without any memory access in between ?
Reference:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddref_57ef.asp
,Jay
Reference:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddref_57ef.asp
,Jay
If it''s freezing when you single-step the code in the debugger, then add the NOSYSLOCK flag to the Lock().
If you don''t specify that flag, then the driver is free to essentially disable/shut down Windows for the duration of the lock. As you can probably guess, this also means your debugger/IDE is disabled too!...
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
If you don''t specify that flag, then the driver is free to essentially disable/shut down Windows for the duration of the lock. As you can probably guess, this also means your debugger/IDE is disabled too!...
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement