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

Started by
2 comments, last by Ademan555 20 years, 4 months ago
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
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
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);
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.

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
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."

This topic is closed to new replies.

Advertisement