LPDIRECT3DCUBETEXTURE9

Posted By: 20BN

LPDIRECT3DCUBETEXTURE9 - 02/06/21 10:33

hello all,
someone help me, how to Release LPDIRECT3DCUBETEXTURE9 texture memory?
LPDIRECT3DCUBETEXTURE9* ABC
....
.....D3DXCreateCubeTextureFromFile....
....
ABC->Release();

ERROR: Release() is nor d3d9.h function.

THANKS!
Posted By: Ayumi

Re: LPDIRECT3DCUBETEXTURE9 - 04/01/24 08:39

Hey, you have to use it right way:

Code

typedef struct _smpCube
{
	LPDIRECT3DCUBETEXTURE9 ShadowMap; 
   
} SmpCube;

SmpCube* SmpCubeObj;


// Cleanup
if(SmpCubeObj->ShadowMap != NULL)
{
   ((LPDIRECT3DCUBETEXTURE9)SmpCubeObj->ShadowMap)->Release();
   SmpCubeObj->ShadowMap = NULL;       
}


Posted By: Aku_Aku

Re: LPDIRECT3DCUBETEXTURE9 - 04/10/24 10:01

Perhaps the bmap_purge() function does the same/similar action.
From the online documentation:
Quote
Releases texture memory used by the given bitmap. Useful for freeing the video memory when a certain panel won't be seen anymore. Video memory is automatically allocated again when the bitmap is seen the next time, so the instruction won't do any harm.
Posted By: Ayumi

Re: LPDIRECT3DCUBETEXTURE9 - 04/12/24 11:00

No, that doesn't work.
Direct X functions can only be used via certain (material) events or by initializing your own D3DInstance.
(Have a look to draw_begin or Gamestudio SDK ->Plugin SDK-> Using Direct3D functions).
© 2024 lite-C Forums