Jump to content
  • Advertisement
Sign in to follow this  

saving textures from app to file

This topic is 4774 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

Hello. I have an odd question. My application performs a series of texture manipulations by rendering to scratch textures. When I use my vertex shader to look at the resulting texture, all is well. When I fall back to FFP, I get a texture with only the colour I used to clear it before redering to it. Is there a way for me to dump intermediate textures to a file so I can inspect the in between stages of the process? G.K.

Share this post


Link to post
Share on other sites
Advertisement
This should work:

// texture is your LPDIRECT3DTEXTURE9
// Get the surface from the texture
LPDIRECT3DSURFACE9 pSurf;
texture->GetSurfaceLevel( 0, &pSurf );

// Output to file
D3DXSaveSurfaceToFile( L"screenshot.bmp", D3DXIFF_BMP, pSurf, NULL, NULL );

// Release the surface
pSurf->Release();

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!