Sign in to follow this  
MrDoomMaster

IDirect3DDevice9::GetFrontBufferData()

Recommended Posts

Please confirm if I am correct or incorrect, and also provide any comments on things I am missing... In order to obtain the front buffer data, I have to do the following: 1) Create a IDirect3DSurface9 object via a call to IDirect3DDevice9::CreateOffscreenPlaneSurface() 2) The size of the Offscreen Surface created in step #1 should be the size of the desktop if in windowed mode, or the size of the display resolution in fullscreen mode 3) Submit the created offscreen surface pointer to IDirect3DDevice9::GetFrontBufferData() and it will be filled with information on the front buffer This is correct, right? I hope so. I'm going to try it. In the meantime, what is a recommended method of getting the pixel size of the desktop? Also, how many bits do I set my offscreen surface to be, depending on windowed or fullscreen mode? Thanks!

Share this post


Link to post
Share on other sites
Quote:
Original post by MrDoomMaster
1) Create a IDirect3DSurface9 object via a call to IDirect3DDevice9::CreateOffscreenPlaneSurface()

The format has to be D3DFMT_A8R8G8B8 for that function call to succeed.

Quote:
Original post by MrDoomMaster
2) The size of the Offscreen Surface created in step #1 should be the size of the desktop if in windowed mode, or the size of the display resolution in fullscreen mode

Correct.

Quote:
Original post by MrDoomMaster
3) Submit the created offscreen surface pointer to IDirect3DDevice9::GetFrontBufferData() and it will be filled with information on the front buffer

Correct. Remember to SAFE_RELEASE() it when you're finished though [wink]

Quote:
Original post by MrDoomMaster
In the meantime, what is a recommended method of getting the pixel size of the desktop?

IDirect3D9::GetAdapterDisplayMode() should return the current information on the desktop resolution..

Quote:
Original post by MrDoomMaster
Also, how many bits do I set my offscreen surface to be, depending on windowed or fullscreen mode?

See my comment above - it's one format, and always one format (from my experience, and also what the SDK docs say) [smile]

hth
Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this