I was getting an error and it broke my brain from thinking so much. And it turns out that in the end I find this.
In this piece of code you can check at home:
With the line:
Code: Select all
Global ih.f=1,nh.a=6,Dim hacescapsula.DualVector3D(nh)Code: Select all
Global nh.a=6,ih.f=1,Dim hacescapsula.DualVector3D(nh)It took me a while to reduce the code to a minimum to show this, but I managed to do it and here it is
Screen does not display anything because it is reduced to only demonstrate de behaviour. Tap to the 'T' key and see:
Code: Select all
InitEngine3D(#PB_Engine3D_NoLog,#PB_Compiler_Home+"Compilers\Engine3d.dll")
If InitMouse()=0 Or InitSprite()=0 Or InitKeyboard()=0:MessageRequester("Error","Can't open DirectX",0):End:EndIf
OpenWindow(0,0,0,800,600,Titulo$,#PB_Window_BorderLess|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600,1,0,0,#PB_Screen_WaitSynchronization)
CreateLight(0,$EEEEEE,4,4,2,#PB_Light_Point)
CreateCamera(0,0,0,100,100)
Structure D3DXVECTOR3
x.f
y.f
z.f
EndStructure
Structure Vector3D Extends D3DXVECTOR3
m.f;<-length(modulo)
EndStructure
Structure DualVector3D
d.Vector3D
n.Vector3D
EndStructure
Global npuntosbeziertuberia.a=2,NewList pun.D3DXVECTOR3()
Global nh.a=6,ih.f=1,Dim hacescapsula.DualVector3D(nh); <- program hangs and debugger not able to trap
; Global ih.f=1,nh.a=6,Dim hacescapsula.DualVector3D(nh); <- with this line instead previous one, then all is as expected.
For i.a=0 To npuntosbeziertuberia
AddElement(pun()):pun()\x=2:pun()\y=1:pun()\z=i
Next
Procedure Tub()
CreateSphere(0,0.5)
ForEach pun()
CreateEntity(ListIndex(pun()),MeshID(0),#PB_Material_None,pun()\x,pun()\y,pun()\z,0)
Next
EndProcedure
Repeat
Repeat:evento.i=WindowEvent():Until evento=#PB_Event_None
ExamineMouse():ExamineKeyboard()
If KeyboardReleased(#PB_Key_T):Tub():EndIf
RenderWorld()
FlipBuffers()
Delay(6)
Until KeyboardPushed(#PB_Key_Escape)
