problem locking mipmap levels for writing

Started by
0 comments, last by Trip99 18 years, 10 months ago
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
Advertisement
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 :)
------------------------See my games programming site at: www.toymaker.info

This topic is closed to new replies.

Advertisement