problem locking mipmap levels for writing
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
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 :)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement