I used to load a texture like this:
D3DXCreateTextureFromFile(gD3DDevice, "Images\\frames.bmp", &temptex);
which was working OK, except that I don't want it to stretch my textures to power of 2 dimensions, so I changed it to this:
HR(D3DXCreateTextureFromFileEx(gD3DDevice, "Images\\frames.bmp",
D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2,
D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, 3DPOOL_DEFAULT,
D3DX_FILTER_NONE, D3DX_FILTER_NONE, 0xFFFFFFFF,
NULL, NULL, &temptex));
As far as I can tell the texture loads fine, and it certainly displays how I want it to. Only problem is, every time I do something that triggers an OnResetDevice(move/resize/maximise the window etc), I continually get breakpoints. The following functions cause breakpoints:
IDirect3DDevice9::Reset
IDirect3DDevice9::SetTransform
IDirect3DDevice9::SetSamplerState
IDirect3DDevice9::SetRenderState
IDirect3DDevice9::SetTextureStageState
At that point I stopped clicking continue, but it appears any function from my d3d device is causing breakpoints.
Oh and I'm handling the return values from all these functions with this macro if it helps at all:
#define HR(x) { HRESULT hr = x; if(FAILED(hr)) { DXTrace(__FILE__, __LINE__, hr, #x, TRUE); } }
And no, the macro isn't mine. It's from a book.
cheers,
metal