本文整理汇总了C++中ReleaseCOM函数的典型用法代码示例。如果您正苦于以下问题:C++ ReleaseCOM函数的具体用法?C++ ReleaseCOM怎么用?C++ ReleaseCOM使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ReleaseCOM函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReleaseCOM
GpuWaves::~GpuWaves()
{
ReleaseCOM(mWavesPrevSolSRV);
ReleaseCOM(mWavesCurrSolSRV);
ReleaseCOM(mWavesNextSolSRV);
ReleaseCOM(mWavesPrevSolUAV);
ReleaseCOM(mWavesCurrSolUAV);
ReleaseCOM(mWavesNextSolUAV);
}
示例2: ReleaseCOM
SolarSysDemo::~SolarSysDemo()
{
delete mGfxStats;
ReleaseCOM(mFX);
ReleaseCOM(mSphere);
ReleaseCOM(mSunTex);
ReleaseCOM(mPlanet1Tex);
ReleaseCOM(mPlanet2Tex);
ReleaseCOM(mPlanet3Tex);
ReleaseCOM(mMoonTex);
DestroyAllVertexDeclarations();
}
示例3: defined
void Scene::BuildFX()
{
DWORD shaderFlags = D3D10_SHADER_ENABLE_STRICTNESS;
#if defined (DEBUG) || (_DEBUG)
shaderFlags |= D3D10_SHADER_SKIP_OPTIMIZATION;
#endif
ID3D10Blob* compilationErrors = 0;
HRESULT hr = 0;
hr = D3DX10CreateEffectFromFile(L"tex.fx", // The name of the effects file to compile
0, // pDefines
0, // pInlcude
"fx_4_0", // The version of the shader we are using
shaderFlags, // Specify how the shader code will be complied
0, // FXflags
m_Direct3DDevice, // A pointer to the direct device
0, // pEffectPool
0, // pPump
&m_FX, // Returns a pointer to the created object
&compilationErrors, // Returns a pointer to a string containing the comiplation errors
0 // pttResult, used with pPump
);
if( FAILED(hr) )
{
if( compilationErrors )
{
// Print out any errors
MessageBoxA( 0, (char*)compilationErrors->GetBufferPointer(), 0, 0);
ReleaseCOM(compilationErrors);
}
DXTrace(__FILE__, (DWORD)__LINE__, hr, L"D3DX10CreateEffectFromFile", true);
}
// Set the technique to color tech
m_Tech = m_FX->GetTechniqueByName("ColorTech");
// Setup variable pointers to the designated name in effect files
m_fxWVPVar = m_FX->GetVariableByName("gWVP")->AsMatrix(); // Set the effect file WVP matrix to
m_fxDiffuseMapVar = m_FX->GetVariableByName("gDiffuseMap")->AsShaderResource();
m_FxSpecMapVar = m_FX->GetVariableByName("gSpecMap")->AsShaderResource();
m_FxEyePosVar = m_FX->GetVariableByName("gEyePosW");
m_FxLightVar = m_FX->GetVariableByName("gLight");
m_FxTexMatVar = m_FX->GetVariableByName("gTexMat")->AsMatrix();
m_FxBoxWorldVar = m_FX->GetVariableByName("gBoxWorld")->AsMatrix();
}
示例4: ReleaseCOM
void DumpMesh::DumpVertices()
{
const D3D10_INPUT_ELEMENT_DESC *pDesc;
UINT declCount = NULL;
m_pMesh->GetVertexDescription(&pDesc, &declCount);
m_Dumpfile << "---------IALayout-----------" << std::endl;
for (size_t i=0; i<declCount; i++)
{
m_Dumpfile.width(10);
m_Dumpfile
<< pDesc[i].SemanticName << "\t"
<< pDesc[i].Format << "\t"
<< pDesc[i].AlignedByteOffset << "\t"
<< pDesc[i].InputSlotClass << "\t"
<< std::endl;
}
// Hard code the position type, should be consistances with the
// IALayout declaration
ID3DX10MeshBuffer *vb = NULL;
m_pMesh->GetVertexBuffer(0, &vb);
VERTEX *vertices = NULL;
SIZE_T vbufferSize;
vb->Map( (void**)&vertices, &vbufferSize );
m_Position.reserve(m_pMesh->GetVertexBufferCount());
////m_Dumpfile << "---------Vertices-----------" << std::endl;
for (size_t i=0; i<m_pMesh->GetVertexCount(); i++)
{
//m_Dumpfile.width(10);
//m_Dumpfile
// << vertices[i].position.x << "\t"
// << vertices[i].position.y << "\t"
// << vertices[i].position.z << "\t"
// << std::endl;
m_Position.push_back(vertices[i].position);
}
vb->Unmap();
ReleaseCOM(vb);
}
示例5: ReleaseCOM
void Ssao::ReleaseTextureViews()
{
ReleaseCOM(mNormalDepthRTV);
ReleaseCOM(mNormalDepthSRV);
ReleaseCOM(mAmbientRTV0);
ReleaseCOM(mAmbientSRV0);
ReleaseCOM(mAmbientRTV1);
ReleaseCOM(mAmbientSRV1);
}
示例6: ReleaseCOM
TerrainClient::~TerrainClient()
{
for(UINT i = 0; i < mSubGrids.size(); ++i)
ReleaseCOM(mSubGrids[i].mesh);
ReleaseCOM(mFX);
ReleaseCOM(mTex0);
ReleaseCOM(mTex1);
ReleaseCOM(mTex2);
ReleaseCOM(mBlendMap);
}
示例7: ReleaseCOM
D3D::~D3D()
{
ReleaseCOM(m_device);
ReleaseCOM(m_deviceContext);
ReleaseCOM(m_renderTargetView);
ReleaseCOM(m_swapChain);
ReleaseCOM(m_depthStencilView);
ReleaseCOM(m_depthStencilBuffer);
m_enumAdapters.Release();
}
示例8: ReleaseCOM
Terrain::~Terrain()
{
for(UINT i = 0; i < mSubGridMeshes.size(); ++i)
ReleaseCOM(mSubGridMeshes[i]);
ReleaseCOM(mFX);
ReleaseCOM(mTex0);
ReleaseCOM(mTex1);
ReleaseCOM(mTex2);
ReleaseCOM(mBlendMap);
}
示例9: D3DDECL_END
HRESULT Mesh::AdjustMeshDecl()
{
HRESULT hr;
LPD3DXMESH pInMesh = mMesh;
LPD3DXMESH pOutMesh = NULL;
D3DVERTEXELEMENT9 vertDecl[ MAX_FVF_DECL_SIZE ] =
{
{0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0},
{0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0},
{0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},
// exact SH-coefficients
{0, 32, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 0},
{0, 48, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 1},
{0, 64, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 2},
{0, 80, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 3},
{0, 96, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 4},
{0, 112, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 5},
{0, 128, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 6},
{0, 144, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 7},
{0, 160, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 8},
{0, 176, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 2},
{0, 188, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 3},
D3DDECL_END()
};
hr = pInMesh->CloneMesh( pInMesh->GetOptions(), vertDecl, mDevice, &pOutMesh );
PD( hr, L"clone mesh" );
if( FAILED(hr) ) return hr;
if( !DoesMeshHaveUsage( D3DDECLUSAGE_NORMAL ) )
{
hr = D3DXComputeNormals( pOutMesh, NULL );
PD( hr, L"compute normals" );
if( FAILED(hr) ) return hr;
}
ReleaseCOM( pInMesh )
mMesh = pOutMesh;
return D3D_OK;
}
示例10: mWidth
ShadowMap::ShadowMap( ID3D11Device* device, UINT width, UINT height )
: mWidth( width ), mHeight( height ), mDepthMapSRV( 0 ), mDepthMapDSV( 0 )
{
mViewport.TopLeftX = 0.0f;
mViewport.TopLeftY = 0.0f;
mViewport.Width = static_cast<float>( width );
mViewport.Height = static_cast<float>( height );
mViewport.MinDepth = 0.0f;
mViewport.MaxDepth = 1.0f;
// Use typeless format because the DSV is going to interpret
// the bits as DXGI_FORMAT_D24_UNORM_S8_UINT, whereas the SRV is going to interpret
// the bits as DXGI_FORMAT_R24_UNORM_X8_TYPELESS.
D3D11_TEXTURE2D_DESC texDesc;
texDesc.Width = mWidth;
texDesc.Height = mHeight;
texDesc.MipLevels = 1;
texDesc.ArraySize = 1;
texDesc.Format = DXGI_FORMAT_R24G8_TYPELESS;
texDesc.SampleDesc.Count = 1;
texDesc.SampleDesc.Quality = 0;
texDesc.Usage = D3D11_USAGE_DEFAULT;
texDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE;
texDesc.CPUAccessFlags = 0;
texDesc.MiscFlags = 0;
ID3D11Texture2D* depthMap = 0;
HR( device->CreateTexture2D( &texDesc, 0, &depthMap ) );
D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc;
dsvDesc.Flags = 0;
dsvDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
dsvDesc.Texture2D.MipSlice = 0;
HR( device->CreateDepthStencilView( depthMap, &dsvDesc, &mDepthMapDSV ) );
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
srvDesc.Format = DXGI_FORMAT_R24_UNORM_X8_TYPELESS;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MipLevels = texDesc.MipLevels;
srvDesc.Texture2D.MostDetailedMip = 0;
HR( device->CreateShaderResourceView( depthMap, &srvDesc, &mDepthMapSRV ) );
// View saves a reference to the texture so we can release our reference.
ReleaseCOM( depthMap );
}
示例11: m_Width
ShadowMap::ShadowMap(ID3D11Device* device, UINT Width, UINT Height)
: m_Width(Width),
m_Height(Height),
m_DepthMapDSV(nullptr),
m_DepthMapSRV(nullptr)
{
m_Viewport.TopLeftX = 0.0f;
m_Viewport.TopLeftY = 0.0f;
m_Viewport.Width = static_cast<FLOAT>(m_Width);
m_Viewport.Height = static_cast<FLOAT>(m_Height);
m_Viewport.MinDepth = 0.0f;
m_Viewport.MaxDepth = 1.0f;
D3D11_TEXTURE2D_DESC td;
td.Width = m_Width;
td.Height = m_Height;
td.MipLevels = 1;
td.ArraySize = 1;
td.Format = DXGI_FORMAT_R24G8_TYPELESS;
td.SampleDesc.Count = 1;
td.SampleDesc.Quality = 0;
td.Usage = D3D11_USAGE_DEFAULT;
td.BindFlags = D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE;
td.CPUAccessFlags = 0;
td.MiscFlags = 0;
ID3D11Texture2D* DepthMap = nullptr;
HR(device->CreateTexture2D(&td, 0, &DepthMap));
D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc;
dsvDesc.Flags = 0;
dsvDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
dsvDesc.Texture2D.MipSlice = 0;
HR(device->CreateDepthStencilView(DepthMap, &dsvDesc, &m_DepthMapDSV));
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
srvDesc.Format = DXGI_FORMAT_R24_UNORM_X8_TYPELESS;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MipLevels = td.MipLevels;
srvDesc.Texture2D.MostDetailedMip = 0;
HR(device->CreateShaderResourceView(DepthMap, &srvDesc, &m_DepthMapSRV));
ReleaseCOM(DepthMap);
}
示例12: mHeight
ShadowMap::ShadowMap(ID3D11Device *device, UINT width, UINT height)
:mWidth(width), mHeight(height), mDepthDSV(0), mDepthSRV(0), mEnable4xMsaa(0), m4xMsaaQuality(0)
{
m_matViewport.TopLeftX = 0.0f;
m_matViewport.TopLeftY = 0.0f;
m_matViewport.Width = static_cast<float>(width);
m_matViewport.Height = static_cast<float>(height);
m_matViewport.MinDepth = 0.0f;
m_matViewport.MaxDepth = 1.0f;
D3D11_TEXTURE2D_DESC texDesc;
texDesc.Width = mWidth;
texDesc.Height = mHeight;
texDesc.MipLevels = 1;
texDesc.ArraySize = 1;
texDesc.Format = DXGI_FORMAT_R24G8_TYPELESS;
texDesc.SampleDesc.Count = 1;
texDesc.SampleDesc.Quality = 0;
texDesc.Usage = D3D11_USAGE_DEFAULT;
texDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE;
texDesc.CPUAccessFlags = 0;
texDesc.MiscFlags = 0;
ID3D11Texture2D * depthMap = 0;
HR(device->CreateTexture2D(&texDesc, 0, &depthMap));
D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc;
dsvDesc.Flags = 0;
dsvDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
dsvDesc.Texture2D.MipSlice = 0;
HR(device->CreateDepthStencilView(depthMap, &dsvDesc, &mDepthDSV));
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
srvDesc.Format = DXGI_FORMAT_R24_UNORM_X8_TYPELESS;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MipLevels = texDesc.MipLevels;
srvDesc.Texture2D.MostDetailedMip = 0;
HR(device->CreateShaderResourceView(depthMap, &srvDesc, &mDepthSRV));
ReleaseCOM(depthMap);
}
示例13: unbind
void D3D9PixelBuffer::bind( uint32 face, uint32 mip, IDirect3DCubeTexture9* texTarget )
{
unbind();
mMipIndex = mip;
mCubeTarget = texTarget;
switch(face)
{
case 0:
mFaceIndex = D3DCUBEMAP_FACE_POSITIVE_X;
break;
case 1:
mFaceIndex = D3DCUBEMAP_FACE_NEGATIVE_X;
break;
case 2:
mFaceIndex = D3DCUBEMAP_FACE_POSITIVE_Y;
break;
case 3:
mFaceIndex = D3DCUBEMAP_FACE_NEGATIVE_Y;
break;
case 4:
mFaceIndex = D3DCUBEMAP_FACE_POSITIVE_Z;
break;
case 5:
mFaceIndex = D3DCUBEMAP_FACE_NEGATIVE_Z;
break;
}
IDirect3DSurface9* suf = NULL;
if (FAILED(texTarget->GetCubeMapSurface(mFaceIndex,mip,&suf)))
{
unbind();
return;
}
D3DSURFACE_DESC desc;
suf->GetDesc(&desc);
mWidth = desc.Width;
mHeight = desc.Height;
mDepth = 1;
mFormat = D3D9Translator::getPixelFormat(desc.Format);
mRowPitch = mWidth * DPixelFormatTool::getFormatBytes(mFormat);
mSlicePitch = mHeight * mRowPitch;
mByteSize = mSlicePitch;
ReleaseCOM(suf);
}
示例14: ReleaseCOM
void MeshGeometry::SetVertices(ID3D11Device* device,
const Vertex::NormalTexVertex* verts,
UINT count)
{
ReleaseCOM(mVB);
D3D11_BUFFER_DESC vbd;
vbd.Usage = D3D11_USAGE_IMMUTABLE;
vbd.ByteWidth = sizeof(Vertex::NormalTexVertex) * count;
vbd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
vbd.CPUAccessFlags = 0;
vbd.MiscFlags = 0;
vbd.StructureByteStride = 0;
D3D11_SUBRESOURCE_DATA vinitData;
vinitData.pSysMem = verts;
HR(device->CreateBuffer(&vbd, &vinitData, &mVB));
}
示例15: SafeDelete
Projekt::~Projekt()
{
SafeDelete(mGenericModel);
//SafeDelete(mSkinnedModel);
SafeDelete(mPlayerModel);
SafeDelete(mSky);
SafeDelete(mShadowMap);
ReleaseCOM(WireFrameRS);
Effects::DestroyAll();
InputLayouts::DestroyAll();
delete GameSettings::Instance();
}