当前位置: 首页>>代码示例>>C++>>正文


C++ LPDIRECT3DVERTEXBUFFER9::Release方法代码示例

本文整理汇总了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();
	}
}
开发者ID:longtuoei,项目名称:CPPadv_WindowsGameProg,代码行数:51,代码来源:HomeWork01.cpp

示例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();
	}
}
开发者ID:trizdreaming,项目名称:windowsGameProg_DirectXTutorial,代码行数:50,代码来源:directXHomeWork_1.cpp

示例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;
}
开发者ID:LiXizhi,项目名称:NPLRuntime,代码行数:34,代码来源:d3dfile.cpp

示例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
}
开发者ID:m3lawren,项目名称:ClothDemo,代码行数:8,代码来源:main.cpp

示例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;
}
开发者ID:blastingzone,项目名称:ComputerGraphicsAdvenced,代码行数:38,代码来源:HeightMap.cpp

示例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; }
}
开发者ID:netpyoung,项目名称:bs.3d_game_programming,代码行数:8,代码来源:2-7.cpp

示例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();
}
开发者ID:arlukin,项目名称:dev,代码行数:21,代码来源:Matrices.cpp

示例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();
}
开发者ID:junglek,项目名称:DirectX-Basic,代码行数:8,代码来源:Main.cpp

示例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();
}
开发者ID:agmonr,项目名称:Emotion_for_windows,代码行数:15,代码来源:Dlg.cpp

示例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();
}
开发者ID:KawaharaKiyohara,项目名称:DirectXLesson_2,代码行数:56,代码来源:Model.cpp

示例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;
	}
}
开发者ID:IharaYuuki2,项目名称:Yuuki,代码行数:16,代码来源:Title.cpp

示例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;
	}
}
开发者ID:IharaYuuki2,项目名称:Yuuki,代码行数:16,代码来源:Title.cpp

示例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;
};
开发者ID:junglek,项目名称:DirectX-Basic,代码行数:50,代码来源:Main.cpp

示例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;
	}
}
开发者ID:SasakiMizuki,项目名称:MizukiRepository,代码行数:17,代码来源:effect.cpp

示例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();
}
开发者ID:erickterri,项目名称:3dlearn,代码行数:17,代码来源:AntiAlisa.cpp


注:本文中的LPDIRECT3DVERTEXBUFFER9::Release方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。