Jump to content
  • Advertisement

Archived

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

Skibum

DX7 Surface Lock function

This topic is 5965 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
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!