What causes Runrev to race?

Are you developing an External using the LiveCode Externals SDK?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

What causes Runrev to race?

Post by n.allan » Sun Jul 13, 2008 6:06 pm

I had just finished wrapping a windows SDK when the vendor had suddenly released a new version. I downloaded the new version and replaced the old dll.

Now suddenly when I initialise the new dll the CPU maxes out and causes the rev ide to "race".

I'm talking about cursor blinks at a rate of knots and, for example, when I go into Object Browser and look at the images, the animated images are "racing" and not animating at the proper speed.

I have tried IdleRate, qtIdlerate, BlinkRate, all the *rates... but the problem remains.

I have spent the last couple of nights on the SDK's forums and they all think/know I'm just crap at programming! but I swear to you all was just perfect using the old dll.

I have however noticed that they added an undocumented "feature" to do with the focus of the control so it can accept keystrokes and mouseups etc.. do you think that rev and the SDK could be fighting for focus?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun Jul 13, 2008 10:31 pm

Hi n.allan,

I don't think I can answer your question without more information.

Which SDK is this? What does it do? How do you use it in Rev?

Do you use any of the *rates for any purpose other than fixing this problem, anywhere else in any script?

Do you actually use that new undocumented feature?


Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Post by n.allan » Mon Jul 14, 2008 12:21 am

It's Blitz3D SDK, I've had no luck on the Blitz Forum. I've done a foolish thing and mucked up all of my code trying to fix what I belive wasn't even broken in the first place. I'll fix it all up in the next couple of days and post a link for the external code. Of course one will need to own the SDK in order to use it fully.

I've just recived permission from BRL to post a demo stack ,demo external and media that wraps some of the functions .

Anyhoo... I simply call the first basic function. bbBeginBlitz3D() and the CPU rockets and the rev IDE goes nuts. I had big plans for this but now I'm completly sickened of the whole damn thing! :evil: :evil: :evil:

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Jul 14, 2008 9:36 am

Hi Allan,

If you can put a demo on-line, I'll have a look.

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Post by malte » Mon Jul 14, 2008 11:11 am

Hi n.allan,

please, pretty please with cream on top try to keep it up. I see this being so extremely useful and I would love to see an external around Blitz3d. That would be very very cool. As I am one of the few doing games in Rev i would really love to have such a beast. Would it be Cross Platform? Or Win only? I am sure there could be help from the mothership if desired...

All the best,

Malte

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Post by n.allan » Mon Jul 14, 2008 1:14 pm

I will post a simple external tonight along with a good guy and bad guy dlls. I will keep it up. I've invested far too much time to give up now. I seem to remember bill from a previous post telling me I was about to climb a mountain, he was sooooooo right! And this would be considered a simple task by most programmers. The code is not pretty but it has no memory leaks that I can see. I left a terrain demo running for about two days with a weight on the keyboard to simulate input :D and never used a byte of memory :D so it's looking good.

Once I have the simple one posted i will go to work on a decent crippled demo external. I say crippled because If i were to post the full compiled external online this would allow ANY one to use the B3D.dll redistributable without paying and I dont want that at all!

I would rather post the source code for VS2008 express and people can link their own blitz3dsdk.lib that they have to purchase and compile from there.

While I'm at it can anyone tell me a better way to convert char * to float? I'm currently using:

float CameraX

if (p_argument_count = 1)
{
CameraX = atof(p_arguments[0]);
}

but I get warnings about losing information. It works well but i suspect we may run into problems in the future. I was always told to treat warnings as errors.

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Post by n.allan » Mon Jul 14, 2008 7:43 pm

Sorry. To answer your questions, It is only win32 unfortunately Malte and mark I had no idea there was an undocumented feature, what I meant by *rates was any command ending in ->rates

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Post by mwieder » Mon Jul 14, 2008 9:32 pm

atof() returns a double. The easiest thing to do would be to declare CameraX as a double instead of a float. If you need to use a float then you could do a simple cast:

float CameraX = (float) atof(p_arguments[0]);

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Jul 14, 2008 10:19 pm

Allan,

I know what you meant by *rates, but you didn't answer my question.

So, I take it you didn't use that undocumented feature? Or you don't know? Maybe you should find out on that other forum.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Post by n.allan » Tue Jul 15, 2008 9:15 am

Of Course. I forgot I could cast the double to float. I've use this lots in the past. It's amazing how small things esacpe you when you are in obsession mode.

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Post by n.allan » Wed Jul 16, 2008 11:09 am

Thanks mwieder for reminding me about the cast.

0 Warnings...
0 Errors...
Compiling....

:D

Post Reply

Return to “Building Externals”