Re: poke4 won't accept my 32bit values

new topic     » goto parent     » topic index » view thread      » older message » newer message

>
> Thanks Derek, but it still doesn't explain why it would work for the
> original Exotica Demos, and not for ExoticaX.. Tells me it has something
> to do with my code, but I can't find it..
>
> I even used the original Exotica demo, and changed only the necessities
> to ExoticaX..  that would be: exotica_init(), and exotica_error().
> That's why I looked there..
>
> create3D_device doesn't cause the program to fail, only when I change
> the lines.. c_proc(EXOTICA_INIT,{NULL}) to exotica_init(), and
> c_func(ON_ERROR,{NULL}) to exotica_error().. the respective ExoticaX
> counterparts.. does the program give me that error..
> Only when I split the WinMain function like I have in ExoticaX do I get
> that error..
>

Well, except that the problem seems to start happening if create3d_device()
is EXECUTED before Euphoria intepreter has PROCESSED (but not executed) the
FrameMove() procedure definition. And this is the case in the original demo
but in your modified demo.

In the original demo, the Init_Loop function, which contains the
create3d_device() call is processed by the interpreter, then the FrameMove
procedure is processed etc... and the create3d_device() function only gets
executed after Euphoria finally gets to the end of the file at the
exotica_execute() function.

But, in your demo, the Init_Loop function has been converted to inline code
and is executed prior to Euphoria interpreter getting to the FrameMove()
procedure definition. If one moves the FrameMove procedure definition nearer
to the front of the file and before the create3d_device() invocation, your
demo works just fine. Move it to just AFTER the create3d_device() call and
your demo fails.

The key to it seems to be that if the create3d_device is EXECUTED prior to
Euphoria processing the definition of FrameMove() then the problem begins to
happen. If create3d_device() is EXECUTED after Euphoria processes the
procedure definition then the problem doesn't happen.

Try it yourself. In the original (working) demo, move the first few lines up
to, and including, the create3d_device() call, out of the Init_Loop()
function to somewhere before the FrameMove() definition. Make sure these
moved lines are executed before the FrameMove() definition is seen by the
interpreter. The problem is now in the original demo too.

------
Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu