本文整理汇总了C++中LPDIRECT3DVERTEXBUFFER9::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECT3DVERTEXBUFFER9::Release方法的具体用法?C++ LPDIRECT3DVERTEXBUFFER9::Release怎么用?C++ LPDIRECT3DVERTEXBUFFER9::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECT3DVERTEXBUFFER9
的用法示例。
在下文中一共展示了LPDIRECT3DVERTEXBUFFER9::Release方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Cleanup
VOID Cleanup()
{
if ( g_pMeshMaterials != NULL )
delete[] g_pMeshMaterials;
if ( g_pMeshTextures )
{
for ( DWORD i = 0; i < g_dwNumMaterials; ++i )
{
if ( g_pMeshTextures[i] )
{
g_pMeshTextures[i]->Release();
}
}
}
if ( g_pMesh )
{
g_pMesh->Release();
}
if ( g_pTexture1 != NULL )
{
g_pTexture1->Release();
}
if ( g_pTexture2 != NULL )
{
g_pTexture2->Release();
}
if ( g_pVB1 != NULL )
{
g_pVB1->Release();
}
if ( g_pVB2 != NULL )
{
g_pVB2->Release();
}
if ( g_pd3dDevice != NULL )
{
g_pd3dDevice->Release();
}
if ( g_pD3D != NULL )
{
g_pD3D->Release();
}
}
示例2: Cleanup
VOID Cleanup()
{
if (NULL != g_pMeshMaterials0)
{
delete [] g_pMeshMaterials0;
}
if (g_pMeshTextures0)
{
for (DWORD i = 0; i < g_dwNumMaterials; ++i)
{
if (g_pMeshTextures0[i])
{
g_pMeshTextures0[i]->Release();
}
}
delete [] g_pMeshTextures0;
}
if (NULL != g_pMesh0)
{
g_pMesh0->Release();
}
if (NULL != g_pTexture0)
{
g_pTexture0->Release();
}
if (NULL != g_pTexture1)
{
g_pTexture1->Release();
}
if (NULL != g_pVertexBuffer0)
{
g_pVertexBuffer0->Release();
}
if (NULL != g_pVertexBuffer1)
{
g_pVertexBuffer1->Release();
}
if (NULL != g_pD3DDevice)
{
g_pD3DDevice->Release();
}
if (NULL != g_pD3D)
{
g_pD3D->Release();
}
}
示例3:
//---------------------------------------------------------------------------------
// Name: ComputeBoundingBox
// Desc:
// pMin:[out] Pointer to a D3DXVECTOR3 structure, describing the returned lower-left
// corner of the bounding box. See Remarks.
// pMax:[out] Pointer to a D3DXVECTOR3 structure, describing the returned upper-right
// corner of the bounding box. See Remarks.
//---------------------------------------------------------------------------------
FLOAT CD3DMesh::ComputeBoundingBox(D3DXVECTOR3 *pMin, D3DXVECTOR3 *pMax )
{
HRESULT hr;
// Lock the vertex buffer, to generate a simple bounding sphere
LPDIRECT3DVERTEXBUFFER9 pMeshVB = NULL;
hr = m_pSysMemMesh->GetVertexBuffer( &pMeshVB );
if( SUCCEEDED(hr) )
{
VOID * pVertices;
hr = pMeshVB->Lock( 0, 0, &pVertices, D3DLOCK_NOSYSLOCK );
if( SUCCEEDED(hr) )
{
hr = D3DXComputeBoundingBox( (D3DXVECTOR3 *)pVertices,
m_pSysMemMesh->GetNumVertices(),
D3DXGetFVFVertexSize(m_pSysMemMesh->GetFVF()),
pMin,
pMax);
pMeshVB->Unlock();
}
pMeshVB->Release();
}
if( FAILED(hr) )
return 0;
return 1;
}
示例4: cleanD3D
// this is the function that cleans up Direct3D and COM
void cleanD3D(void)
{
v_buffer->Release(); // close and release the vertex buffer
font->Release();
d3ddev->Release(); // close and release the 3D device
d3d->Release(); // close and release Direct3D
}
示例5: Cleanup
/**-----------------------------------------------------------------------------
* 초기화 객체들 소거
*------------------------------------------------------------------------------
*/
VOID Cleanup()
{
if ( g_pTexHeight != NULL )
{
g_pTexHeight->Release();
}
if ( g_pTexDiffuse != NULL )
{
g_pTexDiffuse->Release();
}
if ( g_pIB != NULL )
{
g_pIB->Release();
}
if ( g_pVB != NULL )
{
g_pVB->Release();
}
if ( g_pd3dDevice != NULL )
{
g_pd3dDevice->Release();
}
if ( g_pD3D != NULL )
{
g_pD3D->Release();
}
delete[] g_pvHeightMap;
}
示例6: Cleanup
//------------------------------------------------------------------------------
VOID Cleanup()
{
if ( g_pIndexBuff ) { g_pIndexBuff->Release(); g_pIndexBuff = NULL; }
if ( g_pVertexBuff ) { g_pVertexBuff->Release(); g_pVertexBuff = NULL; }
if ( g_pd3dDevice ) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; }
if ( g_pD3D ) { g_pD3D->Release(); g_pD3D = NULL; }
}
示例7: Cleanup
//-----------------------------------------------------------------------------
// Name: Cleanup()
// Desc: Releases all previously initialized objects
//-----------------------------------------------------------------------------
VOID Cleanup()
{
if( g_pTexture != NULL )
g_pTexture->Release();
if( g_pVB != NULL )
g_pVB->Release();
if( g_pVB2 != NULL )
g_pVB2->Release();
if( g_pd3dDevice != NULL )
g_pd3dDevice->Release();
if( g_pD3D != NULL )
g_pD3D->Release();
}
示例8: cleanup
VOID cleanup(){
if(g_pVB != NULL)
g_pVB->Release();
if(g_pDevice != NULL)
g_pDevice->Release();
if(g_pD3D != NULL)
g_pD3D->Release();
}
示例9: Cleanup
//-----------------------------------------------------------------------------
// Name: Cleanup()
// Desc: Releases all previously initialized objects
//-----------------------------------------------------------------------------
VOID CDlg::Cleanup()
{
if( g_pVB != NULL )
g_pVB->Release();
if( g_pd3dDevice != NULL )
g_pd3dDevice->Release();
if( g_pD3D != NULL )
g_pD3D->Release();
}
示例10: Morphing
//モーフィング処理の実行。
//morphTarget モーフターゲット
//rate モーフィングレート。
void Model::Morphing(Model* morphTargetA, Model* morphTargetB, float rate)
{
//モーフターゲットAのメッシュを取得。
LPD3DXMESH targetMesh_A= morphTargetA->GetMesh();
//モーフターゲットAの頂点バッファを取得する。
LPDIRECT3DVERTEXBUFFER9 targetVertexBuffer_A;
targetMesh_A->GetVertexBuffer(&targetVertexBuffer_A);
//頂点バッファの定義を取得する。
D3DVERTEXBUFFER_DESC desc;
targetVertexBuffer_A->GetDesc(&desc);
//頂点ストライドを計算する。
int stride = desc.Size / targetMesh_A->GetNumVertices();
//モーフターゲットBのメッシュを取得する。
LPD3DXMESH targetMesh_B = morphTargetB->GetMesh();
//モーフターゲットBの頂点バッファを取得する。
LPDIRECT3DVERTEXBUFFER9 targetVertexBuffer_B;
targetMesh_B->GetVertexBuffer(&targetVertexBuffer_B);
//自分の頂点バッファを取得する。
LPDIRECT3DVERTEXBUFFER9 vertexBuffer;
mesh->GetVertexBuffer(&vertexBuffer);
D3DXVECTOR3* vertexPos;
D3DXVECTOR3* targetVertexPos_A;
D3DXVECTOR3* targetVertexPos_B;
//頂点バッファをロック。
vertexBuffer->Lock(0, desc.Size, (void**)&vertexPos, D3DLOCK_DISCARD);
targetVertexBuffer_A->Lock(0, desc.Size, (void**)&targetVertexPos_A, D3DLOCK_DISCARD);
targetVertexBuffer_B->Lock(0, desc.Size, (void**)&targetVertexPos_B, D3DLOCK_DISCARD);
for (int vertNo = 0; vertNo < targetMesh_A->GetNumVertices(); vertNo++) {
///////////////////////////////////////////////////////////////////
//ここに頂点モーフの処理を記述する。
///////////////////////////////////////////////////////////////////
//次の頂点へ。
char* p = (char*)vertexPos;
p += stride;
vertexPos = (D3DXVECTOR3*)p;
p = (char*)targetVertexPos_A;
p += stride;
targetVertexPos_A = (D3DXVECTOR3*)p;
p = (char*)targetVertexPos_B;
p += stride;
targetVertexPos_B = (D3DXVECTOR3*)p;
}
//頂点バッファをアンロック。
vertexBuffer->Unlock();
targetVertexBuffer_A->Unlock();
targetVertexBuffer_B->Unlock();
vertexBuffer->Release();
targetVertexBuffer_A->Release();
targetVertexBuffer_B->Release();
}
示例11: UninitTitleGameStart
/*******************************************************************************
* UninitGameStart
*******************************************************************************/
void UninitTitleGameStart(void)
{
if(g_pTextureTitleGameStart != NULL)
{
g_pTextureTitleGameStart->Release();
g_pTextureTitleGameStart = NULL;
}
if(g_pVtxBufferTitleGameStart != NULL)
{
g_pVtxBufferTitleGameStart->Release();
g_pVtxBufferTitleGameStart = NULL;
}
}
示例12: UninitTitleGameName
/*******************************************************************************
* UninitGameName
*******************************************************************************/
void UninitTitleGameName(void)
{
if(g_pTextureTitleGameName != NULL)
{
g_pTextureTitleGameName->Release();
g_pTextureTitleGameName = NULL;
}
if(g_pVtxBufferTitleGameName != NULL)
{
g_pVtxBufferTitleGameName->Release();
g_pVtxBufferTitleGameName = NULL;
}
}
示例13: initGeometry
HRESULT initGeometry(){
LPD3DXBUFFER pD3DXMtrlBuffer;
if(FAILED(D3DXLoadMeshFromX(L"seafloor.x", D3DXMESH_MANAGED,
g_pDevice, NULL, &pD3DXMtrlBuffer, NULL, &g_dwNumMaterials, &g_pMesh)))
return E_FAIL;
//Extract material & texture
D3DXMATERIAL* d3dxMaterials = (D3DXMATERIAL*)pD3DXMtrlBuffer->GetBufferPointer();
g_pMeshMaterials = new D3DMATERIAL9[g_dwNumMaterials];
if(g_pMeshMaterials == NULL)
return E_OUTOFMEMORY;
g_pMeshTextures = new LPDIRECT3DTEXTURE9[g_dwNumMaterials];
if(g_pMeshTextures == NULL)
return E_OUTOFMEMORY;
//Extract
for(DWORD i=0; i<g_dwNumMaterials; ++i){
g_pMeshMaterials[i] = d3dxMaterials[i].MatD3D;
g_pMeshMaterials[i].Ambient = g_pMeshMaterials[i].Diffuse;
g_pMeshTextures[i] = NULL;
if(d3dxMaterials[i].pTextureFilename != NULL && strlen(d3dxMaterials[i].pTextureFilename) > 0){
WCHAR name[256];
removePathFromFileName(d3dxMaterials[i].pTextureFilename, name);
if(FAILED(D3DXCreateTextureFromFile(g_pDevice, name, &g_pMeshTextures[i]))){
MessageBox(NULL, L"Cound not find texture file", L"initGeometry()", MB_OK);
}
}
}
pD3DXMtrlBuffer->Release();
//Modify the mesh
LPDIRECT3DVERTEXBUFFER9 pVB;
if(SUCCEEDED(g_pMesh->GetVertexBuffer(&pVB))){
struct VERTEX{FLOAT x,y,z,tu,tv;};
VERTEX* pVertices;
DWORD dwNumVertices = g_pMesh->GetNumVertices();
pVB->Lock(0,0,(void**)&pVertices, 0);
for(DWORD i=0; i<dwNumVertices; ++i)
pVertices[i].y = heightField(pVertices[i].x, pVertices[i].z);
pVB->Unlock();
pVB->Release();
}
return S_OK;
};
示例14: UninitEffect
//=============================================================================
// 終了処理
//=============================================================================
void UninitEffect(void)
{
if(g_pD3DTextureEffect != NULL)
{// テクスチャの開放
g_pD3DTextureEffect->Release();
g_pD3DTextureEffect = NULL;
}
if(g_pD3DVtxBuffEffect != NULL)
{// 頂点バッファの開放
g_pD3DVtxBuffEffect->Release();
g_pD3DVtxBuffEffect = NULL;
}
}
示例15: Cleanup
//-----------------------------------------------------------------------------
// Desc: 释放创建的对象
//-----------------------------------------------------------------------------
VOID Cleanup()
{
//释放顶点缓冲区对象
if( g_pVB != NULL )
g_pVB->Release();
//释放Direct3D设备对象
if( g_pd3dDevice != NULL )
g_pd3dDevice->Release();
//释放Direct3D对象
if( g_pD3D != NULL )
g_pD3D->Release();
}