CreateImageSurface in Dx9

Recommended Posts

Hey guys I'm still figuring my way through this. I am following through a book (Sam's Teach Yourself Game Programming with Direct X), don't laugh. It was written for DirectX 8.1. I am using 9 so far things have been able to convert over with a few headaches here and there. But this one has me It calls for me to
g_hResult = g_pDirect3DDevice->CreateImageSurface(640, 480, D3DFMT_X8R8G8B8, &g_pBitmapSurface);

However, it refuses to compile and give me [C++ Error] File1.cpp(158): E2316 'CreateImageSurface' is not a member of 'IDirect3DDevice9' as an error. Is this method no longer in DX9? Or what am I doing wrong?

Share on other sites
CreateImageSurface Changes
IDirect3DDevice8::CreateImageSurface was renamed IDirect3DDevice9::CreateOffscreenPlainSurface. An additional parameter that takes a D3DPOOL type was added. D3DPOOL_SCRATCH will return a surface that has identical characteristics to a surface created by the former IDirect3DDevice8::CreateImageSurface. D3DPOOL_DEFAULT is the appropriate pool for use with IDirect3DDevice9::StretchRect and IDirect3DDevice9::ColorFill.

<3 MSDN reference

Create an account

Register a new account

• Forum Statistics

• Total Topics
627718
• Total Posts
2978790

• 9
• 21
• 14
• 12
• 42