本文整理汇总了C++中DeviceMap::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceMap::erase方法的具体用法?C++ DeviceMap::erase怎么用?C++ DeviceMap::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceMap
的用法示例。
在下文中一共展示了DeviceMap::erase方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: myRelease
static ULONG __stdcall myRelease(ID3D10Device *pDevice) {
//TODO: Move logic to HardHook.
// Call base without active hook in case of no trampoline.
ReleaseType oRelease = (ReleaseType) hhRelease.call;
hhRelease.restore();
ULONG res = oRelease(pDevice);
hhRelease.inject();
Mutex m;
DeviceMap::iterator it = devices.find(pDevice);
if (it != devices.end()) {
D10State *ds = it->second;
// If we are receiving a lot of subsequent releases lets eagerly drop
// our state object. If the device presents something again a state
// object is created again just fine anyway.
if (res < ds->lHighMark / 2) {
ods("D3D10: Deleting resources %u < 0.5 * %u", res, ds->lHighMark);
devices.erase(it);
chains.erase(ds->pSwapChain);
delete ds;
ods("D3D10: Deleted");
ds = NULL;
}
}
return res;
}
示例2: resizeD3D10
void resizeD3D10(IDXGISwapChain *pSwapChain) {
// Remove the D10State from our "cache" (= Invalidate)
SwapchainMap::iterator it = chains.find(pSwapChain);
if (it != chains.end()) {
D10State *ds = it->second;
devices.erase(ds->pDevice);
chains.erase(it);
delete ds;
}
}
示例3: DelDevice
int32_t CParseDevice::DelDevice(uint32_t nId)
{
//check Id
DeviceMap::iterator deviceIter = g_deviceMap.find(nId);
if (deviceIter == g_deviceMap.end())
{
return fail;
}
//delete
delete (*deviceIter).second;
g_deviceMap.erase(deviceIter);
return success;
}
示例4: presentD3D10
// D3D10 specific logic for the Present function.
void presentD3D10(IDXGISwapChain *pSwapChain) {
ID3D10Device *pDevice = NULL;
HRESULT hr = pSwapChain->GetDevice(__uuidof(ID3D10Device), (void **) &pDevice);
if (SUCCEEDED(hr) && pDevice) {
SwapchainMap::iterator it = chains.find(pSwapChain);
D10State *ds = it != chains.end() ? it->second : NULL;
if (ds && ds->pDevice != pDevice) {
ods("D3D10: SwapChain device changed");
devices.erase(ds->pDevice);
delete ds;
ds = NULL;
}
if (ds == NULL) {
ods("D3D10: New state");
ds = new D10State(pSwapChain, pDevice);
if (!ds->init()) {
pDevice->Release();
delete ds;
return;
}
chains[pSwapChain] = ds;
devices[pDevice] = ds;
}
ds->draw();
pDevice->Release();
} else {
#ifdef EXTENDED_OVERLAY_DEBUGOUTPUT
// DXGI is used for multiple D3D versions. Thus, it is possible a device
// associated with the DXGISwapChain may very well not be a D3D10 one,
// in which case we can safely ignore it.
ods("D3D10: Could not draw because ID3D10Device could not be retrieved.");
#endif
}
}
示例5:
// D3D11 specific logic for the Present function.
extern void presentD3D11(IDXGISwapChain *pSwapChain) {
ID3D11Device *pDevice = NULL;
HRESULT hr = pSwapChain->GetDevice(__uuidof(ID3D11Device), (void **) &pDevice);
if (SUCCEEDED(hr) && pDevice) {
SwapchainMap::iterator it = chains.find(pSwapChain);
D11State *ds = it != chains.end() ? it->second : NULL;
if (ds && ds->pDevice != pDevice) {
ods("D3D11: SwapChain device changed");
devices.erase(ds->pDevice);
delete ds;
ds = NULL;
}
if (ds == NULL) {
ods("D3D11: New state");
ds = new D11State(pSwapChain, pDevice);
if (!ds->init()) {
pDevice->Release();
delete ds;
return;
}
chains[pSwapChain] = ds;
devices[pDevice] = ds;
}
ds->draw();
pDevice->Release();
} else {
#ifdef EXTENDED_OVERLAY_DEBUGOUTPUT
// DXGI is used for multiple D3D versions. Thus, this is expected if
// another version is used (like D3D10).
ods("D3D11: Could not draw because ID3D11Device could not be retrieved.");
#endif
}
}