Sign in to follow this  
Esh

problam with CreateImageSurface method

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this