i've come to a point in eveloping the G42 that i'm ready to begin coding the simulation logic behind the workings of the ship
first thing i thought i'd do, is add a "mode switch" delay between engine configurations....
while this could be achieved easily by using "in-transition" states, this isn't much of a reusable approach, and will increase the spaghettiness of my module a bit
so i was wondering how i could proceed with this and similar situations... in Flash and JavaScript, which i'm largely accustomed to, i'd just use setTimeout() and have it call a function after a set amount of milliseconds....
but c++ has no such function :shifty:
would it be worthy, or even advisable at all, to create my own implementation of setInterval? - and in doing so, should i go with using a separate thread, or do i have a loop checking live intervals?
i assume the latter would be more suitable, and safe to use... since Orbiter itself appears to run single-threaded (does it?) :uhh:
but with the advent of whole-bunch-of-cores-CPU's, i can't help but to feel like threading is the "proper way" of doing things :huh:
any thoughts?
first thing i thought i'd do, is add a "mode switch" delay between engine configurations....
while this could be achieved easily by using "in-transition" states, this isn't much of a reusable approach, and will increase the spaghettiness of my module a bit
so i was wondering how i could proceed with this and similar situations... in Flash and JavaScript, which i'm largely accustomed to, i'd just use setTimeout() and have it call a function after a set amount of milliseconds....
but c++ has no such function :shifty:
would it be worthy, or even advisable at all, to create my own implementation of setInterval? - and in doing so, should i go with using a separate thread, or do i have a loop checking live intervals?
i assume the latter would be more suitable, and safe to use... since Orbiter itself appears to run single-threaded (does it?) :uhh:
but with the advent of whole-bunch-of-cores-CPU's, i can't help but to feel like threading is the "proper way" of doing things :huh:
any thoughts?