Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


DDraw Lock();

This topic is 5922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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-

Share this post

Link to post
Share on other sites
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 ?



Share this post

Link to post
Share on other sites
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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!