Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#ActualTim Sarbin

Posted 20 January 2013 - 10:38 PM

Thanks! I'm in the process of creating that function so I simply hadn't added it yet, but I went ahead and did it so I won't forget later smile.png

Anyway, I linked the lib and added a tracew and got the actual error: D3DERR_INVALIDCALL. I also replaced the standard call with the EX version and added a get image info function, which also fails (the INVALIDCALL is comming from that first block). Looks like I'm off to a GREAT start sleep.png

 

	D3DXIMAGE_INFO info;
	HRESULT hr = D3DXGetImageInfoFromFileInMemory((LPCVOID)data,size,&info);
	if (FAILED(hr)) {
		DXTraceW(__FILE__, __LINE__, hr, TEXT("Error"), true);
		wxMessageBox( "Error getting image info for tileset data!", "Error", wxOK | wxICON_ERROR );
		return;
	}

	if (FAILED(D3DXCreateTextureFromFileInMemoryEx(d3dDevice, (LPCVOID)data, size, info.Width, info.Height,
		1, 0, info.Format, D3DPOOL_MANAGED, D3DX_FILTER_NONE, D3DX_FILTER_NONE, 0, &info, NULL, &d3dTexture))) {
		d3dTexture = NULL;
		wxMessageBox( "Error loading tileset data!", "Error", wxOK | wxICON_ERROR );
	};

#1Tim Sarbin

Posted 20 January 2013 - 10:34 PM

Thanks! I'm in the process of creating that function so I simply hadn't added it yet, but I went ahead and did it so I won't forget later :)

Anyway, I linked the lib and added a tracew and got the actual error: D3DERR_INVALIDCALL. I also replaced the standard call with the EX version and added a get image info function, which also fails (the INVALIDCALL is comming from that first block). Looks like I'm off to a GREAT start -_-

 

	D3DXIMAGE_INFO info;
	HRESULT hr = D3DXGetImageInfoFromFileInMemory((LPCVOID)data,size,&info);
	if (FAILED(hr)) {
		DXTraceW(__FILE__, __LINE__, hr, TEXT("Error"), true);
		wxMessageBox( "Error getting image info for tileset data!", "Legend of Waffles", wxOK | wxICON_ERROR );
		return;
	}

	if (FAILED(D3DXCreateTextureFromFileInMemoryEx(d3dDevice, (LPCVOID)data, size, info.Width, info.Height,
		1, 0, info.Format, D3DPOOL_MANAGED, D3DX_FILTER_NONE, D3DX_FILTER_NONE, 0, &info, NULL, &d3dTexture))) {
		d3dTexture = NULL;
		wxMessageBox( "Error loading tileset data!", "Legend of Waffles", wxOK | wxICON_ERROR );
	};

PARTNERS