MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / BindTexture

Method BindTexture

GTE/Graphics/DX11/DX11Engine.cpp:1554–1577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1552}
1553
1554DX11Texture2* DX11Engine::BindTexture(std::shared_ptr<Texture2> const& texture,
1555 ID3D11Texture2D* dxTexture, ID3D11ShaderResourceView* dxSRView)
1556{
1557 LogAssert(
1558 texture != nullptr && dxTexture != nullptr && dxSRView != nullptr,
1559 "Attempt to bind a null object.");
1560
1561 mGOMapMutex.lock();
1562 GraphicsObject const* gtObject = texture.get();
1563 auto iter = mGOMap.find(gtObject);
1564 if (iter == mGOMap.end())
1565 {
1566 auto geObject = std::make_shared<DX11Texture2>(texture.get(), dxTexture, dxSRView);
1567 LogAssert(geObject, "Null object. Out of memory?");
1568
1569 iter = mGOMap.insert(std::make_pair(gtObject, geObject)).first;
1570#if defined(GTE_GRAPHICS_USE_NAMED_OBJECTS)
1571 geObject->SetName(texture->GetName());
1572#endif
1573 }
1574 DX11Texture2* dx11Texture2 = static_cast<DX11Texture2*>(iter->second.get());
1575 mGOMapMutex.unlock();
1576 return dx11Texture2;
1577}
1578
1579bool DX11Engine::Update(std::shared_ptr<Buffer> const& buffer)
1580{

Callers

nothing calls this directly

Calls 3

endMethod · 0.80
GetNameMethod · 0.80
SetNameMethod · 0.45

Tested by

no test coverage detected