Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
JSN
22
Years of Service
User Offline
Joined: 8th Nov 2003
Location: 127.0.0.1
Posted: 28th Nov 2003 01:40
On a few PC's, you can have an IRQ (Interrupt Request) which can be a small program running in the background, totally independent of the main code.

Does anyone have any pointers on something similar in DBP?

For example, suppose you have Goodguy (player controled) being chased by Badguy (cpu), is the only way to control what BadGuy does through calling a function within a DO... ...LOOP, or can BadGuy have an IRQ assigned to him?

TIA

~ J ~
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Nov 2003 08:52
Nope, no IRQs or multithreading within DBPro. You have to move it yourself a step at a time in your main loop
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Nov 2003 10:04
You could use IanM's C module system to run your C program as an interrupt which calls DBPro commands...


Mirrors are more fun than television. Well, that was fun, in a not-so-fun sort of way...
JSN
22
Years of Service
User Offline
Joined: 8th Nov 2003
Location: 127.0.0.1
Posted: 28th Nov 2003 10:53
6ugger!

O well, not too bad I guess, right, off to code Mr. Badguy!!!!

~ J ~
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Nov 2003 19:16
@TCA, not if you don't want your program to crash you wouldn't. The DBP libraries are not coded to allow multithreading
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Nov 2003 19:32
surely a flag in the interrupt routine to prevent multiple calls should be sufficient - something alone the lines of :

if (flag)
{
return;
}

flag=true
DBPro->cls(0);
flag=false;


Mirrors are more fun than television. Well, that was fun, in a not-so-fun sort of way...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Nov 2003 19:49
... and if the main DBPro program is rendering, and you decide to change the mesh of an object in your thread?
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Nov 2003 20:43 Edited at: 28th Nov 2003 20:45
...which you wouldn't do anyway, as its not safe. However, things like object movement and such should be okay - probably anything that doesn't modify data.


Mirrors are more fun than television. Well, that was fun, in a not-so-fun sort of way...

Login to post a reply

Server time is: 2026-07-27 01:33:07
Your offset time is: 2026-07-27 01:33:07