whenever i use a while loop the game crashes, BTW i am using Irrlicht....
I tried everthing, i don't understand why it crashes....
maybe i have to add someting when i use while loop... so if any1 knows how to implement a correct while loop to LOOp obviously when useing Irrlicht engine
Thanks
game crashes when while loop used
-
- Posts: 19
- Joined: Thu Feb 09, 2006 1:45 am
what are threads and stick
you are correct that the while loop does halt the engine... i think stops the main loop:
driver->beginScene(...);
driver->end scene();
i am using a while loop for the timer... actually to jump
/////////////////////////////////////////////////////////////
while(now!=time that was set)
{
driver->beginScene(...); // i think this helps the engine to do on
jump;
reverse gravity
driver->end scene();
}
stop jump
put gravuty back on
///////////////////////////////////////////////
BUT IT STILL CARSHES
am i missing something
thanks
you are correct that the while loop does halt the engine... i think stops the main loop:
driver->beginScene(...);
driver->end scene();
i am using a while loop for the timer... actually to jump
/////////////////////////////////////////////////////////////
while(now!=time that was set)
{
driver->beginScene(...); // i think this helps the engine to do on
jump;
reverse gravity
driver->end scene();
}
stop jump
put gravuty back on
///////////////////////////////////////////////
BUT IT STILL CARSHES
am i missing something
thanks
TO ALL THE AMATEURS OUT THERE LIKE ME......
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
Does it actually crash or just halt the program?
Because it seems that that would just stop everything until the time comes along, and the while loop will just stop EVERYTHING from happening, no rendering will be done, because everything's carried out sequentially.
You either need to introduce threads (allowing concurrent execution of different bits of code) or in the while(device->run()) loop do a check to see if the time has arrived, but not using a while loop.
Because it seems that that would just stop everything until the time comes along, and the while loop will just stop EVERYTHING from happening, no rendering will be done, because everything's carried out sequentially.
You either need to introduce threads (allowing concurrent execution of different bits of code) or in the while(device->run()) loop do a check to see if the time has arrived, but not using a while loop.
well it just stops... but it doesn't work again.... actually the program doesn't respond anymore completely even after the time given in the while loop, it just doesn't respond anymore and i am force to ctrl + alt + del to end task the exe...
so i am not sure what to call it except crash
idea about check the time in the main loop... i tried that but it doesn't work for me and it makes the program extremely laggy...
i will keep on trying... and please keep on giving me ideas
THANKS
so i am not sure what to call it except crash
idea about check the time in the main loop... i tried that but it doesn't work for me and it makes the program extremely laggy...
i will keep on trying... and please keep on giving me ideas
THANKS