Sign in to follow this  
bueyuekt

problem locking mipmap levels for writing

Recommended Posts

bueyuekt    122
Hello... I am sitting here for a long time to success in locking mipmap surfaces. I create a Texture with several mipmap levels (CreateTexture). When i try to lock a special mipmap level with LockRect, i get an error and it is not working. It only works for mipmap level 0 here is code: D3DLOCKED_RECT LockedRect; m_Direct3DDevice->CreateTexture( m_Width, m_Height, 0, m_Usage, m_PixelFormat, D3DPOOL_DEFAULT, &m_Texture, NULL); m_Texture->GetSurfaceLevel( 1, &DestSurface ); DestSurface->LockRect(&LockedRect, NULL, D3DLOCK_DISCARD); LockRect creates error code: D3DERR_INVALIDCALL Earlier mentioned, for mipmap level 0 it is working. Can somebody help?? thx

Share this post


Link to post
Share on other sites
Trip99    577
You cannot lock it if it is assigned to D3DPOOL_DEFAULT as that memory is not locakable - hope that makes sense my English is flakey tonight :)

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