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


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

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


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

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

示例2: Game_End

void Game_End()
{
    if (imgShip) imgShip->Release();
	if (imgAsteroid) imgAsteroid->Release();

    DirectInput_Shutdown();
    Direct3D_Shutdown();
}
开发者ID:kyphelps,项目名称:spring-2013,代码行数:8,代码来源:MyGame.cpp

示例3: freeTexture

void freeTexture() {
  if (hmap_o) delete[] hmap_o; hmap_o = NULL;
  if (dmap  ) delete[] dmap  ; dmap   = NULL;

  if (tnrm) tnrm->Release(); tnrm = NULL;
  if (thgt) thgt->Release(); thgt = NULL;
  if (tcol) tcol->Release(); tcol = NULL;
}
开发者ID:Ethatron,项目名称:Oscape,代码行数:8,代码来源:texture.cpp

示例4: Cleanup

void Cleanup()
{
	// 폰트를 release 한다.
	if (gpFont)
	{
		gpFont->Release();
		gpFont = NULL;
	}

	// 모델을 release 한다.
	if (gpSphere)
	{
		gpSphere->Release();
		gpSphere = NULL;
	}

	// 쉐이더를 release 한다.
	if (gpNormalMappingShader)
	{
		gpNormalMappingShader->Release();
		gpNormalMappingShader = NULL;
	}

	// 텍스처를 release 한다.
	if (gpStoneDM)
	{
		gpStoneDM->Release();
		gpStoneDM = NULL;
	}

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

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

	// D3D를 release 한다.
	if (gpD3DDevice)
	{
		gpD3DDevice->Release();
		gpD3DDevice = NULL;
	}

	if (gpD3D)
	{
		gpD3D->Release();
		gpD3D = NULL;
	}
}
开发者ID:popekim,项目名称:ShaderPrimerKR,代码行数:55,代码来源:ShaderFramework.cpp

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

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

示例7: cleanD3D

// this is the function that cleans up Direct3D and COM
void cleanD3D(void)
{
    v_buffer->Release();    // close and release the vertex buffer
    pTexture->Release();
    d3ddev->Release();    // close and release the 3D device
    d3d->Release();    // close and release Direct3D
}
开发者ID:ChrisG0x20,项目名称:five-pixel-font,代码行数:8,代码来源:dx_test.cpp

示例8:

void CD3DCG::ensureTextureSize(LPDIRECT3DTEXTURE9 &tex, D3DXVECTOR2 &texSize,
							   D3DXVECTOR2 wantedSize,bool renderTarget)
{
	HRESULT hr;

	if(!tex || texSize != wantedSize) {
		if(tex)
			tex->Release();

		hr = pDevice->CreateTexture(
			wantedSize.x, wantedSize.y,
			1, // 1 level, no mipmaps
			renderTarget?D3DUSAGE_RENDERTARGET:0,
			renderTarget?D3DFMT_X8R8G8B8:D3DFMT_R5G6B5,
			renderTarget?D3DPOOL_DEFAULT:D3DPOOL_MANAGED, // render targets cannot be managed
			&tex,
			NULL );

		texSize = wantedSize;

		if(FAILED(hr)) {
			DXTRACE_ERR_MSGBOX(TEXT("Error while creating texture"), hr);
			return;
		}
	}
}
开发者ID:LuigiBlood,项目名称:snes9x-sx2,代码行数:26,代码来源:CD3DCG.cpp

示例9: ReleaseTexture

void Renderer::ReleaseTexture( LPDIRECT3DTEXTURE9 pTexture )
{
	if ( pTexture )
	{
		pTexture->Release();
	}
}
开发者ID:SHPURDYdBurt,项目名称:https-github.com-xbmc-atv2,代码行数:7,代码来源:Renderer.cpp

示例10: UninitFade

//============================================================
//	終了処理
//============================================================
void UninitFade(void){
	if(g_pTextureFade != NULL){
		//テクスチャの開放
		g_pTextureFade->Release();
		g_pTextureFade = NULL;
	}
}
开发者ID:SasakiMizuki,项目名称:MizukiRepository,代码行数:10,代码来源:Fade.cpp

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

示例12: return

lpta::LptaTexture::DATA LptaD3DTextureManager::GenerateDefaultData(void)
{
    LPDIRECT3DTEXTURE9 textureData = nullptr;
    D3DLOCKED_RECT d3dLockedRect;
    HRESULT result = d3ddev->CreateTexture(
        DEFAULT_TEXTURE_WIDTH, DEFAULT_TEXTURE_HEIGHT,
        1, 0,
        D3DFMT_A8R8G8B8,
        D3DPOOL_MANAGED,
        &textureData,
        nullptr
    );
    if (FAILED(result)) {
        throw TextureD3DFailure("could not obtain texture object for default");
    }
    result = textureData->LockRect(0, &d3dLockedRect, nullptr, 0);
    if (FAILED(result)) {
        textureData->Release();
        throw TextureD3DFailure("failed to lock rectangle to set default texture color");
    }
    unsigned long *rawData = (unsigned long *)d3dLockedRect.pBits;
    for (unsigned long *pixel = rawData; 
        pixel < rawData + (DEFAULT_TEXTURE_WIDTH * DEFAULT_TEXTURE_HEIGHT); ++pixel) {

        *pixel = DEFAULT_TEXTURE_COLOR;
    }
    textureData->UnlockRect(0);
    return (lpta::LptaTexture::DATA)textureData;
}
开发者ID:elElmo,项目名称:LaputaEngine,代码行数:29,代码来源:LptaD3DTextureManager.cpp

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

示例14: l_Image_Load

int l_Image_Load( lua_State* L )
{
	D3DXIMAGE_INFO imgInfo;
	const char* fileName = lua_tostring( L, 1 );

	bool dxtCompression = false;
	D3DFORMAT d3dfmt = D3DFMT_UNKNOWN;
	//check for dds format
	{
		if( _strcmpi( "dds", fileName + strlen( fileName ) - 3 ) == 0 )
		{
			DDSHEAD header;
			FILE* f;
			if(fopen_s( &f, fileName, "rb" ) == 0)
			{
				if( fread( &header, sizeof(header), 1, f ) == 1 )
				{
					if( strncmp( (const char*)header.Signature, "DDS ", 4 ) == 0 && ( header.FourCC == D3DFMT_DXT1 || header.FourCC == D3DFMT_DXT3 || header.FourCC == D3DFMT_DXT5 ) )
					{
						d3dfmt = D3DFMT_A8R8G8B8;
					}
				}
				fclose(f);
			}
		}
	}

	LPDIRECT3DTEXTURE9 texture; 

	HRESULT hr = D3DXCreateTextureFromFileEx( g_pd3dDevice, fileName, D3DX_DEFAULT_NONPOW2,  D3DX_DEFAULT_NONPOW2, D3DX_FROM_FILE, 0, d3dfmt, D3DPOOL_SCRATCH, D3DX_DEFAULT, D3DX_DEFAULT, 0, &imgInfo, 0, &texture );

	if( FAILED( hr ) )
	{
		return 0;
	}

	ImageData* imgData = createImage();
	imgData->width = imgInfo.Width;
	imgData->height = imgInfo.Height;
	imgData->format = getFormatByD3D( imgInfo.Format );
	imgData->imgData = malloc( imgData->width * imgData->height * imgData->format->bytesPerPixel );

	D3DLOCKED_RECT rect;
	texture->LockRect(0, &rect, 0, 0 );

	memcpy( imgData->imgData, rect.pBits, imgData->width * imgData->height * imgData->format->bytesPerPixel );

	texture->UnlockRect( 0 );

	texture->Release();

	//lua_pushlightuserdata( L, imgData );

	ImageData** luaData = lua_pushimage( L );

	*luaData = imgData;

	return 1;
}
开发者ID:Amorph,项目名称:imageprocesstool,代码行数:59,代码来源:image_lua.cpp

示例15: Game_End

void Game_End()
{
    //free memory and shut down
    paladin->Release();

    DirectInput_Shutdown();
    Direct3D_Shutdown();
}
开发者ID:kyphelps,项目名称:spring-2013,代码行数:8,代码来源:MyGame.cpp


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