Jump to content
  • Advertisement

Archived

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

Ademan555

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

This topic is 5441 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
Advertisement
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
yah thanx, i actually pasted my post in the begginers forum too, and they told me to look up the pool stuff in the sdk docs, so yah, thanx

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!