Today start wrapping Blitz3d SDK for my little game project and found some bug.
Then i run script i have strange error, output:
Main script name: C:\Program Files\thinBasic\My Project\b3d sdk\sample.tbasic
Included script:
Error code: 30
Error description: Variable not defined or misspelled Keyword
Line number: 14.9999997646012
Line code: MESH = CREATECUBE(0)
Token found: CREATECUBE
Additional info:
BUT then i run script in DEBUG mode all working fine.
those kind of errors usually occurs when there is some memory corruption due to incorrect stack passing parameters.
It can occurs when external function/sub library is defined incorrectly or when a parameter type is not the supposed type ... and for many other reasons related to incorrect declarations.
I think the problem is in Graphics3D execution. After the call to Graphics3D, script starts to corrupt memory
Well, I think this is definitely a bug in thinBasic CDECL external function calling.
I've created a PowerBasic application doing exactly what your script dose and it works perfectly.
Problem starts after calling the following:
Graphics3D(800, 600, 32, 0)
application stack gets corrupted.
I think the problem is related to CDECL calling convention. thinBasic is not doing the right things in cleaning parameters from the stack after function execution.
I need to disassemble the PowerBasic application I did and see how it is working with the stack.
Sorry but this is not something very quick to solve.