Jump to content
  • Advertisement
Sign in to follow this  
Jan Birsa

Screenshot problem

This topic is 3437 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 am trying to make a screenshot in C++ DX9 using DXUT, but I have some problems. I have fixed one already. The device didn't work as it should, I fixed that, and now device isn't NULL anymore. It makes screenshot, but the problem is, its black. I get something.bmp, but its black, which is another frustrating problem I have. I guess there is something wrong with surface... Here is the code: HRESULT WINAPI CaptureScreen(IDirect3DDevice9* pd3dDevice) { IDirect3DSurface9* pSurface; //IDirect3DDevice9 *pd3dDevice = DXUTGetD3D9Device(); if (pd3dDevice != NULL) { //DXUTShutdown( 0 ); //proof device isnt NULL pd3dDevice->CreateOffscreenPlainSurface(1024, 768, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &pSurface, NULL); pd3dDevice->GetFrontBufferData(0, pSurface); } D3DXSaveSurfaceToFile(L"Media\\Screenshots\\something.bmp",D3DXIFF_BMP,pSurface,NULL,NULL); pSurface->Release(); return 0; }

Share this post


Link to post
Share on other sites
Advertisement
Run dxcpl.exe and switch to the Debug version of Direct3D. This usually outputs exactly why GetFrontBufferData() wasn't able to read the front buffer.

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!