Click here to Skip to main content
15,885,088 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
extern IDirect3DDevice9* g_pd3dDevice;

void MainFrame::TakeScreenShot()
{
   // F***ing find a way to do this alreadY GRR O_O
   IDirect3DSurface9* pSurface;
   g_pd3dDevice->CreateOffscreenPlainSurface(800, 600,D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &pSurface, NULL);
   g_pd3dDevice->GetFrontBufferData(0, pSurface);
   D3DXSaveSurfaceToFile("Desktop.bmp",D3DXIFF_BMP,pSurface,NULL,NULL);
   pSurface->Release();
}


I'm using this methode someone on this web site as writtten though I get two errors.

C:/Users/dL-Tower/Desktop/DLAS 3.0.0/DLAS/MainFrame.cpp:81: error: 'D3DXIFF_BMP' was not declared in this scope

C:/Users/dL-Tower/Desktop/DLAS 3.0.0/DLAS/MainFrame.cpp:81: error: 'D3DXSaveSurfaceToFile' was not declared in this scope


Im including this in my .h file :)


// direct x
#include <d3d9.h>
#include <d3d9types.h>
#include <d3d9caps.h>


I am using Qt and C++
Posted
Updated 1-Jan-10 8:12am
v3

1 solution

For D3DX* functions, you need the d3d9x* includes (and to link with the d3dx9.lib).

Try: #include <d3dx9tex.h>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900