lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> It seems that too many people are having problems with this 
> DirectX issue.
> How can we solve that??

It is not only a DirectX issue, that's just one library that is a known
offender.  And, unfortunately, the number2int macro isn't the only
issue...  We've had this fp control word trouble even in a Lua 4
project.  Our app would crash at strange and unpredictable places.  It
took us a *long* time to pinpoint the problem.  In our case, a sound
driver changed the fp control word.  If I remember correctly, the crash
was then caused by a fp underflow (or overflow) exception that was
thrown at us (instead of being silently ignored.)  To make things worse,
this exception is not thrown immediately, but it remains pending until
some further interaction with the fpu (I've forgotten the details, but
it was pretty hairy stuff.)

We fixed this by explicitly restoring the fp control word following a
PlaySound call.  Maybe this could be integrated by providing a
lua_set_fpcw macro (like the lua_lock/lua_unlock) that is executed after
each C call?

--
Wim

--8<--discard--8<--discard--8<--discard--8<--

This message and attachment(s) are intended solely for the use of the addressee and may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable law.  
If you are not the intended recipient or agent thereof responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.  
If you have received this communication in error, please notify the sender immediately by telephone and with a "reply" message.  
Thank you for your cooperation.