ENABLE_RENDER and ENABLE_TREE

Posted By: Dyc

ENABLE_RENDER and ENABLE_TREE - 07/09/07 11:23

returning 1 from the event function doesn’t seem to cause the entity to not be rendered by the engine as the manual suggests it should.
Posted By: jcl

Re: ENABLE_RENDER and ENABLE_TREE - 07/09/07 11:27

I can not confirm this. Check your code.
Posted By: Dyc

Re: ENABLE_RENDER and ENABLE_TREE - 07/09/07 11:28

Well do I need to return a var or int ?
Posted By: jcl

Re: ENABLE_RENDER and ENABLE_TREE - 07/09/07 11:29

A var.
Posted By: Dyc

Re: ENABLE_RENDER and ENABLE_TREE - 07/09/07 11:33

Hmm have not tried it in wdl but in lite-c and using the plugin sdk it does not seem to work.

This is from the manual faq.

int Render_Entity(void)
{// Get pointers to all objects you need
ENTITY* pEntity = (ENTITY*)ev->me;
BMAP* pSkin = (BMAP*)ev->render_map[0];
LPD3DXMESH pMesh = (LPD3DXMESH)ev->render_mesh; D3DMATERIAL9* pMaterial = (D3DMATERIAL9*)ev->render_d3dmaterial;
LPD3DXEFFECT pEffect = (LPD3DXEFFECT)ev->render_d3dxeffect; IDirect3DDevice9* pd3dDevice = (IDirect3DDevice9*)ev->pd3ddev;// now render it
...
// tell the engine not to render the entity again
return 1;}

void Render_Init(void)
{
ev->mat_model->event = (EVENT)Render_Entity;
ev->mat_model->flags |= ENABLE_RENDER;
ev->mat_model->effect = "technique dummy { pass one { } }";
}



*EDIT
You were right, there was a problem with my entity effect.
Works now, Thanks
Posted By: jcl

Re: ENABLE_RENDER and ENABLE_TREE - 07/09/07 12:08

Yes, this code is wrong. It must be a var. If you use an int, you can alternatively return 1024. I'll correct the FAQ.
© 2024 lite-C Forums