Sign in to follow this  

IDirectDrawSurface9 to Texture

Recommended Posts

Hi guys, I've got an IDirect3DSurface9 which contains a copy of back buffer (copied using IDirect3DDevice9::StretchRect(...) ), and I now want to draw this back to the screen as a texture. I have been unable to locate a way of converting the surface to a texture in order to draw it. Does anyone know a way of doing this? Thanks in advance. - James

Share this post

Link to post
Share on other sites
Well did you make a texture and a surface?

get yer back buffer...

then create the texture...

then tie it together...

check for info about each... If ya need specifics u cant find just say

ALSO: if u want to make sure its saving correctly, do a:

Share this post

Link to post
Share on other sites
The way that I was doing it:

IDirect3DTexture9* m_pBackBuffer = 0;
m_pDevice->CreateTexture(800, 600, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, 0);

IDirect3DSurface9* pSurface = 0;
m_pBackBuffer->GetSurfaceLevel(0, &pSurface);
m_pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pSurface);

I'm not sure if that is the exact code, since I'm on a different computer, but I believe that is the gist of what I was doing.

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