• Advertisement

Archived

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

DX7 Surface Lock function

This topic is 5669 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 have the following code:
  
	DWORD * ptr;
	DDSURFACEDESC2 desc;
	int pixelsperrow;
	HRESULT hRet;
	RECT rect;
	
	memset(&desc, 0, sizeof(DDSURFACEDESC2));
	hRet = m_GS->getBackBuffer()->Lock(NULL, &desc, DDLOCK_SURFACEMEMORYPTR | DDLOCK_NOSYSLOCK | DDLOCK_WAIT, NULL);
	FAILED_THROW_DD("Lock failed with value of: ", hRet, INFO);

	ptr = (DWORD*)desc.lpSurface;
	pixelsperrow = desc.lPitch/4;
	for(int i=0;i<500;i++)
		ptr[i+i*pixelsperrow] = i;
	m_GS->getBackBuffer()->Unlock(0);
	FAILED_THROW("Restore failed with value of: ", hRet, INFO);
  
the Lock fails, getting the return value of -2147024809 which I believe to be "One or more of the parameters passed to the method are incorrect." Any ideas?

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement