Hi Petr,
sorry for the inconvenience. I didn't test this properly. But I foudn the bug allready and know how to fix it. I will release a new version tonight.
Michael
Hi Mike,
I had some time to start to play with TBEM module, but I found a little problem which demonstrates following script.
Maybe it is just that I misunderstood something.
The script should add 5 rabbits and 3 wolves ( no, I am not drunk, just test sample ):
[code=thinbasic]
uses "CONSOLE"
uses "TBEM"
begin const
%evt_AddElement = 1
end const
Scene_Init()
' -- Prepair events
dim eventAdd as long
eventAdd = TBEM_AddEvent("Scene_AddRabbit", %evt_AddElement)
TBEM_Addtrigger(%evt_AddElement)
TBEM_setRepeat(eventAdd, %TRUE, 1000)
console_PrintLine("Program started, it will add 5 rabbits, 3 wolves and then end ")
while Scene_Built = 0
' -- Our event loop
TBEM_Run
wend
' -- Aux functions
sub Scene_Init()
Global Scene_Built as long = 0
Global Scene_NumRabbits as long = 0
Global Scene_NumWolves as long = 0
end sub
sub Scene_AddRabbit()
if Scene_NumRabbits = 5 then
TBEM_SetEventFunc(eventAdd, "Scene_AddWolf")
console_printline("-- Time to spawn wolves")
else
incr Scene_NumRabbits
console_printline("Rabbit"+STR$(Scene_NumRabbits)+" added")
endif
end sub
sub Scene_AddWolf()
if Scene_NumWolves = 3 then
TBEM_SetEventFunc(eventAdd, "Scene_AddRabbit")
Scene_Built = 1
else
incr Scene_NumWolves
console_printline("Wolf"+STR$(Scene_NumWolves)+" added")
endif
end sub
[/code]
After adding 5 rabbits and changing the func to add wolves it GPFs.
Thanks,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Hi Petr,
sorry for the inconvenience. I didn't test this properly. But I foudn the bug allready and know how to fix it. I will release a new version tonight.
Michael
No problem,
thanks a lot.
Programming dynamic allocation stuff is always dangerous, but when tuned right it is perfect
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Hi Petr,
please download the new version from here:
http://community.thinbasic.com/index...11718#msg11718
It was a pointer bug but should be squished for now.
Thanks for quick fix,
now it works as it should on my PC, very nice!
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Bookmarks