使用D3DXGetImageInfoFromFile()
函数给了我这个:
Unhandled exception at 0x004114d4 in SAMPLE.exe: 0xC0000005: Access violation reading location 0x00000000.
这是包含错误的一段代码:
// ...
WCHAR *Path = L"./LIFE.bmp";
D3DXIMAGE_INFO *Info;
IDirect3DSurface9 *Surface = NULL;
LPDIRECT3DDEVICE9 pd3dDevice;
// ...
D3DXGetImageInfoFromFile(Path, Info); // everything is fine here, unless i do the following:
pd3dDevice -> CreateOffscreenPlainSurface(Info->Width, Info->Height, Info->Format, D3DPOOL_SYSTEMMEM, &Surface, NULL);
那么,这里发生了什么?当我输入数字而不是 时Info->...
,一切正常......