• Advertisement
Sign in to follow this  

problam with CreateImageSurface method

This topic is 3942 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

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..

Share this post


Link to post
Share on other sites
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);

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement