DX9_BackbufferGrabber.h 927 B

12345678910111213141516171819202122232425262728
  1. #include <d3dx9.h>
  2. #include "SQLiteLoggerCommon.h"
  3. class DX9_BackbufferGrabber
  4. {
  5. public:
  6. // Width and height are size of the surface to copy to
  7. DX9_BackbufferGrabber();
  8. ~DX9_BackbufferGrabber();
  9. // Call before using LockBackbufferCopy or ReleaseBackbufferCopy
  10. void InitBackbufferGrabber(LPDIRECT3DDEVICE9 pd3dDevice, int _width, int _height);
  11. // blob is an output parameter. Unchanged if the copy fails.
  12. // blob->data is only valid until you call ReleaseBackbufferCopy
  13. // If pd3dDevice is 0, it will use whatever was passed to InitBackbufferGrabber
  14. void LockBackbufferCopy(RakNet::RGBImageBlob *blob);
  15. // Call ReleaseBackbufferCopy after calling LockBackbufferCopy, when you are done with blob.
  16. void ReleaseBackbufferCopy(void);
  17. protected:
  18. IDirect3DSurface9 * pDestSurface, *pRenderTargetSurface;
  19. int width;
  20. int height;
  21. bool needsUnlock;
  22. LPDIRECT3DDEVICE9 deviceUsedToInit;
  23. };
粤ICP备19079148号