problam with CreateImageSurface method

Started by
1 comment, last by Esh 17 years ago
hi all.. i'm using one of DirectX's methods called CreateImageSurface and for some reason it failed. here is the code, maybe u could help me..

if (FAILED(m_pD3DDevice->CreateImageSurface(256,256,(D3DFORMAT)m_iD3DFormat, &m_pD3DSurface)))
	{
		return E_FAIL;
	}
m_pD3DDevice is initialized ok. i tried initialize the iD3DFormat with all three flags: D3DLOCK_NO_DIRTY_UPDATE D3DLOCK_NOSYSLOCK D3DLOCK_READONLY but it still fails..
Advertisement
I just looked at an example from a book I had lying around on my desk and for the format of the surface, it is usually the same format used when creating the device. If your not sure what format you used(did not set one). Then try using this:

m_pD3DDevice->CreateImageSurface(256,256,D3DFMT_X8R8G8B8,&m_pD3DSurface);
hi it's worked!

for some reason this book i'm learning from did not mention any initializing
of m_iD3DFormat with D3DFMT_X8R8G8B8.

but it did have me initializing other variable with that value. wierd..

thanks anyway..

This topic is closed to new replies.

Advertisement