Help!
by VoroneTZ. 10/14/25 05:04
|
|
|
|
|
|
|
|
|
2 registered members (VoroneTZ, TipmyPip),
9,297
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
DirectX guru needed! Questions about ID3DXMESH->Release();
#402449
06/05/12 12:53
06/05/12 12:53
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Hiya guys...
Ive got a bit of an odd one here. Im doing some LPD3DXMESH juggling and Ive hit a snag. This is crudely what Im doing... (pseudo-code, not actual syntax)
LPD3DXMESH mesh0 = ent_getmesh(ent,0,0); LPD3DXMESH mesh1 = D3DXCreateMesh(...); ent_setmesh(ent,mesh1,0,0); mesh0->Release();
All works fine, now here is the rub...
At home on my Win7 machine it works fine... But here at work it crashes when it hits the Release() calls... (Both computers are running 8.30.5 commercial, and both have Nvidia video cards)
Any ideas anyone?
Secondary to that issue... is 'Release" NECESSARY with gamestudio? I will be running it quite often so these left-over meshes must be cleared out during run-time, otherwise I will have problems...
Thankx muchly guys and gals...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: DirectX guru needed! Questions about ID3DXMESH->Release();
[Re: EvilSOB]
#402452
06/05/12 13:36
06/05/12 13:36
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
Im not the guru your looking for but to further stress this ,i have same situation i cant use release it crashes on release ,i have windows 7 ultimate also nvidia card i think i have directx 10 or 11 cant remember now but i share the problem aswell i try using sysfree dont think it works i dong know but i use it anyway
Compulsive compiler
|
|
|
Re: DirectX guru needed! Questions about ID3DXMESH->Release();
[Re: Wjbender]
#402465
06/05/12 22:04
06/05/12 22:04
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
Not sure if this should work, but try this way:
LPD3DXMESH mesh0 = ent_getmesh(ent,0,0);
LPD3DXMESH mesh1 = D3DXCreateMesh(...);
ent_setmesh(ent,mesh1,0,0);
// deallocate mesh at end of level or game
mesh0 = ent_getmesh(ent,0,0);
mesh0->Release();
ent_setmesh(ent,NULL,0,0);
Secondary to that issue... is 'Release" NECESSARY with gamestudio? You can set a mesh that you've allocated, but you should then release it yourself at the end of the game
|
|
|
Re: DirectX guru needed! Questions about ID3DXMESH->Release();
[Re: rojart]
#402474
06/06/12 05:29
06/06/12 05:29
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Wjbender :: Mine is the other way around... It works in Win7, but fails in XP.
Rojart :: That dont help me much dude. Im going to be generating too many to wait till engine-exit, cause I may not de doing level_load's. I NEED to release them 'on the fly'.
But at least I now know they DO need to be released, I just gotta figure out HOW...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: DirectX guru needed! Questions about ID3DXMESH->Release();
[Re: EvilSOB]
#417150
02/09/13 03:55
02/09/13 03:55
|
Joined: Mar 2006
Posts: 2,252
Hummel
Expert
|
Expert
Joined: Mar 2006
Posts: 2,252
|
This is an old thread, but here is a solution which works for me: ent_setmesh((p_Block)->Entity, NULL, 0, 0); (p_Block->Mesh)->Release(); p_Block->Mesh = newMesh; ent_setmesh(p_Block->Entity, newMesh, 0, 0); Without ent_setmesh((p_Block)->Entity, NULL, 0, 0); it crashes even when I put the ent_setmesh(p_Block->Entity, newMesh, 0, 0); at the top instead.
|
|
|
|