本文整理汇总了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;
}
示例2: Game_End
void Game_End()
{
if (imgShip) imgShip->Release();
if (imgAsteroid) imgAsteroid->Release();
DirectInput_Shutdown();
Direct3D_Shutdown();
}
示例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;
}
示例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;
}
}
示例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();
}
}
示例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();
}
}
示例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
}
示例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;
}
}
}
示例9: ReleaseTexture
void Renderer::ReleaseTexture( LPDIRECT3DTEXTURE9 pTexture )
{
if ( pTexture )
{
pTexture->Release();
}
}
示例10: UninitFade
//============================================================
// 終了処理
//============================================================
void UninitFade(void){
if(g_pTextureFade != NULL){
//テクスチャの開放
g_pTextureFade->Release();
g_pTextureFade = NULL;
}
}
示例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
}
示例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;
}
示例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();
}
示例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;
}
示例15: Game_End
void Game_End()
{
//free memory and shut down
paladin->Release();
DirectInput_Shutdown();
Direct3D_Shutdown();
}