Archived

This topic is now archived and is closed to further replies.

CreateImageSurface function in dx9?!?!??!!

This topic is 5129 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

ok, i need to create a new surface, and the best i coudl find was something like createoffscreensurface or something like that, but the proto didnt come even close to matching that of the CreateImageSurface function, i need an equivalent pretty much, or if someone could teach me how to achieve the same effect. thanx -Dan

Share this post


Link to post
Share on other sites
You''re right, the newer function is CreateOffscreenPlainSurface. I encountered the same problem when converting my DX8 code to DX9, but here''s what I did:

Old Code (DX8)

g_pd3dDevice->CreateImageSurface(Bitmap.bmWidth,Bitmap.bmHeight, D3DFMT_A8R8G8B8, ppSurface);

New Code (DX9)

g_pd3dDevice->CreateOffscreenPlainSurface(Bitmap.bmWidth, Bitmap.bmHeight, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, ppSurface, NULL);

Share this post


Link to post
Share on other sites
Just a side note, if you want the indentical surface type created, then this blurb in the docs mentions that you should use D3DPOOL_SCRATCH.

D3DPOOL_SCRATCH will return a surface that has identical characteristics to a surface created by the Microsoft® DirectX® 8.x method CreateImageSurface.

Share this post


Link to post
Share on other sites