CreateImageSurface function in dx9?!?!??!!
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
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)
New Code (DX9)
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);
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.
D3DPOOL_SCRATCH will return a surface that has identical characteristics to a surface created by the Microsoft® DirectX® 8.x method CreateImageSurface.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement