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


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

本文整理汇总了C++中LPDIRECT3D9::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECT3D9::Release方法的具体用法?C++ LPDIRECT3D9::Release怎么用?C++ LPDIRECT3D9::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LPDIRECT3D9的用法示例。


在下文中一共展示了LPDIRECT3D9::Release方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: InitD3D

BOOL InitD3D(HWND hwnd)
{
	HRESULT hr;
	D3DDISPLAYMODE disp_mode;
	D3DPRESENT_PARAMETERS pp;

	if (g_bSetupOK) return TRUE;

	if (g_pD3D) return FALSE;

	g_pD3D = Direct3DCreate9(D3D_SDK_VERSION);
	if (!g_pD3D) return FALSE;
	
	hr = g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &disp_mode);
	if (FAILED(hr)) 
	{
		g_pD3D->Release();
		g_pD3D = NULL;
		return FALSE;
	}
	
	ZeroMemory(&pp, sizeof(D3DPRESENT_PARAMETERS));
	pp.Windowed = true;
	pp.SwapEffect = D3DSWAPEFFECT_DISCARD;
	pp.BackBufferFormat = disp_mode.Format;
	pp.EnableAutoDepthStencil = TRUE;
	pp.AutoDepthStencilFormat = D3DFMT_D16;
    pp.BackBufferCount = 1;

	BOOL flgSoft = GetPrivateProfileInt("GENERIC","LEVEL",1,".\\TDWGame.ini");

	char buff[256];
	wsprintf(buff,"%d",flgSoft);
	WritePrivateProfileString("GENERIC","LEVEL",buff,".\\TDWGame.ini");

	hr = g_pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hwnd,D3DCREATE_HARDWARE_VERTEXPROCESSING,&pp,&g_pD3DDevice);
	if (FAILED(hr))
	{
		hr = g_pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hwnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&pp,&g_pD3DDevice);
		if (FAILED(hr)) 
		{
			hr = g_pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_REF,hwnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&pp,&g_pD3DDevice);
			if (FAILED(hr)) 
			{
				g_pD3D->Release();
				g_pD3D = NULL;
				return FALSE;
			}
		}
	}

	D3DCAPS9 DX9DCaps;
	g_pD3DDevice->GetDeviceCaps(&DX9DCaps);
	g_bSetupOK = TRUE;
	return TRUE;	
}
开发者ID:fedaykinofdune,项目名称:ffxinfinity,代码行数:56,代码来源:TDWGame.cpp

示例2: dx9vid_shutdown

void dx9vid_shutdown()
{
   g_screenSprite->Release(); // release the screen sprite
   g_screenTex->Release(); // release the screen texture
   d3ddev->Release();    // close and release the 3D device
   d3d->Release();    // close and release Direct3D
}
开发者ID:frangarcj,项目名称:neogpc,代码行数:7,代码来源:video_directx.cpp

示例3: 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_pD3DDevice )
	{
		g_pD3DDevice->Release();
	}

	if ( NULL != g_pD3D )
	{
		g_pD3D->Release();
	}
}
开发者ID:trizdreaming,项目名称:usingConvertedXfromFBX,代码行数:32,代码来源:fbxToXWithBlender.cpp

示例4: 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

示例5: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int cmdShow)
{
    gui.reset(new GUI::GuiWrapper());
    simulation.reset(new Simulation());

    runSimulation = 
        InitialiseWindow(&hInstance) && 
        InitialiseDirectX() &&  
        simulation->CreateSimulation(hInstance, hWnd, d3ddev) &&
        InitialiseGUI();

    while(runSimulation && gui->Update())
    {
        simulation->Update();
        simulation->Render();
    }

    d3ddev->Release();
    d3d->Release();
    backBuffer->Release();

    #ifdef _DEBUG
    OutputDebugString("Exiting Simulation\n");
    #endif
}
开发者ID:huaminglee,项目名称:cloth-simulator,代码行数:25,代码来源:winmain.cpp

示例6: Cleanup

//-----------------------------------------------------------------------------
// Desc: 释放创建的对象
//-----------------------------------------------------------------------------
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();
		}
		delete[] g_pMeshTextures;
	}

	//释放网格模型对象
	if( g_pMesh != NULL )
		g_pMesh->Release();

	//释放Direct3D设备对象
	if( g_pd3dDevice != NULL )
		g_pd3dDevice->Release();

	//释放Direct3D对象
	if( g_pD3D != NULL )
		g_pD3D->Release();
}
开发者ID:as2120,项目名称:ZNginx,代码行数:32,代码来源:StateControlUseMatrix.cpp

示例7: Direct3D_Shutdown

void Direct3D_Shutdown()
{
    if (spriteobj) spriteobj->Release();

    if (d3ddev) d3ddev->Release();
    if (d3d) d3d->Release();
}
开发者ID:kyphelps,项目名称:spring-2013,代码行数:7,代码来源:MyDirectX.cpp

示例8: cleanup

void cleanup()   // it's a dirty job.. but some function has to do it...
{
    if (myRect1)
        delete myRect1;
    if (myRect2)
        delete myRect2;
    if (myRect3)
        delete myRect3;
    if (myRect4)
        delete myRect4;
    if (myRect5)
        delete myRect5;

    if ( lpD3DDevice9 != NULL )
        lpD3DDevice9->Release();

    if ( lpD3D9 != NULL )
        lpD3D9->Release();

    if ( lpD3DXFont != NULL )
        lpD3DXFont->Release();

    if ( lpD3DTex1 != NULL )
        lpD3DTex1->Release();
}
开发者ID:pnchang,项目名称:advgraphics,代码行数:25,代码来源:example04.cpp

示例9: 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

示例10: CleanupD3D

// リソースの解放
void CleanupD3D()
{
	for (int i = 0; i < MAXMODEL; i = i + 1)
	{
		if (g_models[i].used == TRUE)
		{
			if (g_models[i].pmaterials != NULL)
			{
				delete[] g_models[i].pmaterials;
			}
			if (g_models[i].ptextures != NULL)
			{
				for (DWORD j = 0; j < g_models[i].nummaterials; j = j + 1)
				{
					g_models[i].ptextures[j]->Release();
				}
				delete[] g_models[i].ptextures;
			}
			if (g_models[i].pmesh != NULL)
			{
				g_models[i].pmesh->Release();
			}
		}
	}
	if (g_pd3dDevice != NULL) g_pd3dDevice->Release();
	if (g_pD3D != NULL) g_pD3D->Release();

	if (g_pDIDevice != NULL)
	{
		g_pDIDevice->Unacquire();
		g_pDIDevice->Release();
	}
	if (g_pDI != NULL) g_pDI->Release();
}
开发者ID:muripoLife,项目名称:catSenkan,代码行数:35,代码来源:my3dlib.cpp

示例11:

RageDisplay_D3D::~RageDisplay_D3D()
{
	LOG->Trace( "RageDisplay_D3D::~RageDisplay()" );

	GraphicsWindow::Shutdown();

	if( g_pd3dDevice )
	{
		g_pd3dDevice->Release();
		g_pd3dDevice = NULL;
	}

	if( g_pd3d )
	{
		g_pd3d->Release();
		g_pd3d = NULL;
	}

	/* Even after we call Release(), D3D may still affect our window. It seems
	 * to subclass the window, and never release it. Free the DLL after
	 * destroying the window. */
	if( g_D3D9_Module )
	{
		FreeLibrary( g_D3D9_Module );
		g_D3D9_Module = NULL;
	}
}
开发者ID:AratnitY,项目名称:stepmania,代码行数:27,代码来源:RageDisplay_D3D.cpp

示例12: 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_pd3dDevice != NULL )
	{
		g_pd3dDevice->Release();
	}

	if ( g_pD3D != NULL )
	{
		g_pD3D->Release();
	}
}
开发者ID:longtuoei,项目名称:CPPadv_WindowsGameProg,代码行数:31,代码来源:HomeWork02.cpp

示例13: 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

示例14: Cleanup

//-----------------------------------------------------------------------------
// Name: Cleanup()
// Desc: Releases all previously initialized objects
//-----------------------------------------------------------------------------
static void Cleanup()
{
    if( g_pd3dDevice != NULL )
        g_pd3dDevice->Release();

    if( g_pD3D != NULL )
        g_pD3D->Release();
}
开发者ID:Thyfate,项目名称:melax,代码行数:12,代码来源:winsetup.cpp

示例15: 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


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