SHari
asked on
Lock Issue While using DirectDraw
Iam using DirectDraw Component to create primary surface in windowed mode , when i try to lock
the primary surface to acess the primary surface memory , it works, but some times it won't allow me to lock the surface it gives me DDERR_GENERIC. This problem persists until i exit from the application. Can any one help me.
Here is the code
hr = lpDDSPrimary->Lock( NULL , &ddsd, DDLOCK_WAIT |DDLOCK_SURFACEMEMORYPTR | DDLOCK_READONLY , NULL );
if(hr ==DD_OK)
{
if(ddsd.lpSurface !=NULL)
{
// i will do processing of surface here
}
lpDDSPrimary->Unlock(ddsd. lpSurface) ;
}
else
{
CString eMsg="Error in lock ";
GetErrorMsg(hr,eMsg);
throw "Error Unable to Lock Surface";
}
Thnaks in advance
the primary surface to acess the primary surface memory , it works, but some times it won't allow me to lock the surface it gives me DDERR_GENERIC. This problem persists until i exit from the application. Can any one help me.
Here is the code
hr = lpDDSPrimary->Lock( NULL , &ddsd, DDLOCK_WAIT |DDLOCK_SURFACEMEMORYPTR | DDLOCK_READONLY , NULL );
if(hr ==DD_OK)
{
if(ddsd.lpSurface !=NULL)
{
// i will do processing of surface here
}
lpDDSPrimary->Unlock(ddsd.
}
else
{
CString eMsg="Error in lock ";
GetErrorMsg(hr,eMsg);
throw "Error Unable to Lock Surface";
}
Thnaks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
My brain says many cards and drivers will not allow access to the primary buffer via locking.
What are you trying to do that you need to lock the primary? and not double-buffering and locking down the back-buffer instead?
-d