Skip to content

Instantly share code, notes, and snippets.

@shvyrev
Created September 5, 2014 13:36
Show Gist options
  • Save shvyrev/54f869a1136c52999683 to your computer and use it in GitHub Desktop.
Save shvyrev/54f869a1136c52999683 to your computer and use it in GitHub Desktop.
LPDIRECT3DSURFACE9 Surface;
D3DXIMAGE_FILEFORMAT FileFormat;
// Grab the current image in our front buffer.
d3d_device->CreateOffscreenPlainSurface( ScreenWidth, ScreenHeight, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &Surface, NULL );
// Copy everything from the front buffer to our surface.
d3d_device->GetFrontBufferData( 0, Surface );
// Write the contents of the surface to the given file.
D3DXSaveSurfaceToFile("hero", D3DXIFF_PNG, Surface, NULL, NULL);
Surface->Release( );
Surface = NULL;
@donotfeedaslender
Copy link

 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment