Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualEndemoniada

Posted 06 September 2013 - 08:17 PM

Hi guys,

 

I'm rendering my depth values to a D3DFMT_R32F texture that I want to save as a bitmap (or copy to clipboard) to see what it looks like. After I get it onto a plain surface so I can lock the rect I don't know what to do:

// all the work to get it on a plain surface is done

// now lock to get at the values
plain_surface->LockRect(&locked_rect,NULL,0);

// loop through each pixel
BYTE* src;

for(uint i=0;i<desc.Height;i++){
 src=(BYTE*)locked_rect.pBits+i*locked_rect.Pitch;
 for(uint j=0;j<desc.Width;j++){
   // float f = this is what I need
   // ...to fill my destination pixels here
   src+=4;
 }
}

Please help. Thanks.

 

PS - I'm using D3D9


#1Endemoniada

Posted 06 September 2013 - 08:16 PM

Hi guys,

 

I'm rendering my depth values to a D3DFMT_R32F texture that I want to save as a bitmap (or copy to clipboard) to see what it looks like. After I get it onto a plain surface so I can lock the rect I don't know what to do:

// all the work to get it on a plain surface is done

// now lock to get at the values
plain_surface->LockRect(&locked_rect,NULL,0);

// loop through each pixel
BYTE* src;

for(uint i=0;i<desc.Height;i++){
 src=(BYTE*)locked_rect.pBits+i*locked_rect.Pitch;
 for(uint j=0;j<desc.Width;j++){
   // float f = this is what I need
   // ...to fill my destination pixels here
   src+=4;
 }
}

Please help. Thanks.

 


PARTNERS