Currently Writing a new system, and I've put a small box with a texture on it, with DirectX11 (which was previously working before I started adding more unrelated code).
Now for some unknown reason, I've receiving this unhandled exception:
http://img15.imageshack.us/img15/5666/textureunload.png
Continuing will loop the same problem. I'm probably missing something really stupid, but I'd really like some insight to why this is happening.. Thanks!
Texture.cpp
#include "Texture.h"
/* Constructor & Deconstructor */
Texture::Texture()
{
m_texture = 0;
}
Texture::~Texture(){}
/* Initialize */
bool Texture::Init(ID3D11Device* device, CHAR* filename)
{
HRESULT r;
//Load texture
r = D3DX11CreateShaderResourceViewFromFile(device, filename, NULL, NULL, &m_texture, NULL);
if(FAILED(r))
{return false;}
return true;
}
/* Return objects we are using to higher level */
ID3D11ShaderResourceView* Texture::GetTexture()
{return m_texture;}
/* Shutdown/Release Objects we have used */
void Texture::Shutdown()
{
if(m_texture)
{
m_texture->Release();
m_texture = 0;
}
return;
}