Using D3DXGetImageInfoFromFile()
function gives me this:
Unhandled exception at 0x004114d4 in SAMPLE.exe: 0xC0000005: Access violation reading location 0x00000000.
Here is the piece of code that contains error:
// ...
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);
So, what is happening here? And when I type in numbers instead of Info->...
, everything works fine...