Jump to content

question about LE callbacks


Wchris
 Share

Recommended Posts

It's just theory

 

If i set a LE callback and in this calback i use LE commands can i get an infinite loop ?

 

i mean : LE command -> callback -> LE command inside callback -> same callback -> etc ...

 

can this happen and would the program freeze or continue to render ?

 

i fact i want to know if it's safe to use LE commands inside callbacks or if it should be avoided ?

 

thank you

 

PS: i'm writing a component for Tentity and want to handle the callback response as an event, so i have two choices,

either call directly the event from callback, or send a message to the main thread to execute the

callback code in the main loop separately to avoid conflicts. Of course, solution 1 is easyer to code.

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

I don't think the engine can tell the difference between a method and a callback function and would assume that for instance moving an entity in a UpdateMatrix callback would result in the callback getting called again.

 

Therefore I would try to avoid it.

Link to comment
Share on other sites

I don't think the engine can tell the difference between a method and a callback function and would assume that for instance moving an entity in a UpdateMatrix callback would result in the callback getting called again.

 

Therefore I would try to avoid it.

 

Yes i agree, thats why i hesitate.

 

But it depends how the engine works. If the callbacks are only launched once in updateworld xor renderword and never from within other individual commands, then the engine is already serializing callbacks and i don't have to do it again. But of course if have no way to get the info.

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

If you make a simple test of this you should be able to see what it's doing.

 

you mean "Applog" before and after renderworld and updateworld and inside callbacks ?

 

Hey, yes this could tell me what's going on. I'll try this.

 

Thank you Rick, you're always helpfull :)

 

You're always in advance ahead of me :D

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...