bool D3D9Texture::GetInternalData() { try { Video *pVideo = m_video.lock().get(); m_pDevice = boost::any_cast<IDirect3DDevice9*>(pVideo->GetGraphicContext()); } catch (const boost::bad_any_cast &) { std::wstringstream ss; ss << L"D3D9Texture::GetInternalData: Invalid device"; ShowMessage(ss, GSMT_ERROR); return false; } return true; }
bool D3D9Sprite::GetInternalData() { try { m_pTexture = boost::any_cast<IDirect3DTexture9*>(m_texture->GetTextureObject()); } catch (const boost::bad_any_cast &) { std::wstringstream ss; ss << L"D3D9Sprite::GetInternalData Invalid texture pointer" << std::endl; ShowMessage(ss, GSMT_ERROR); return false; } Video *video = m_video.lock().get(); try { m_pDevice = boost::any_cast<IDirect3DDevice9*>(video->GetGraphicContext()); } catch (const boost::bad_any_cast &) { std::wstringstream ss; ss << L"D3D9Sprite::GetInternalData Invalid device" << std::endl; ShowMessage(ss, GSMT_ERROR); return false; } try { m_pVideoInfo = boost::any_cast<D3D9VideoInfoPtr>(video->GetVideoInfo()); } catch (const boost::bad_any_cast &) { std::wstringstream ss; ss << L"D3D9Sprite::GetInternalData Video::GetVideoInfo returns an invalid D3D9VideoInfo object" << std::endl; ShowMessage(ss, GSMT_ERROR); return false; } return true; }