Hi,
I just converted my D3D engine to DX7, and almost everything
worked, except for mipmapping. I create a mipmap texture
like this:
ZeroMemory( &ddsd2, sizeof(ddsd2) );
ddsd2.dwSize = sizeof(ddsd2);
ddsd2.dwFlags = DDSD_CAPS / DDSD_WIDTH / DDSD_HEIGHT / DDSD_MIPMAPCOUNT / DDSD_PIXELFORMAT;
ddsd2.ddsCaps.dwCaps = DDSCAPS_TEXTURE / DDSCAPS_MIPMAP / DDSCAPS_COMPLEX;
ddsd2.dwWidth = m_iWidth;
ddsd2.dwHeight = m_iHeight;
ddsd2.dwMipMapCount = m_iMipCount;;
ddsd2.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE;
memcpy(&ddsd2.ddpfPixelFormat, &ddpfTextureFormats[ iTextureFormatToUse ], sizeof(DDPIXELFORMAT));
if (lpDDraw->CreateSurface(&ddsd2, &lpTextureSurface, NULL) != DD_OK)
return FALSE;
Looks OK, right?
Then I load a bitmap into the surface and scale/filter it
to put in the mipmap chain. I access my mipmap like this:
ddsCaps.dwCaps = DDSCAPS_TEXTURE / DDSCAPS_MIPMAP;
hr = lpTextureSurface->GetAttachedSurface( &ddsCaps, &lpMipMap );
But GetAttachedSurface just returns DDERR_NOTFOUND...
What am I doing wrong?
Greets Tobias