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.

Dark GDK / User Plug-Ins for DarkGDK?

Author
Message
Mike J
Retired Moderator
18
Years of Service
User Offline
Joined: 7th Jul 2006
Location: Binghamton, NY, USA
Posted: 6th Mar 2008 21:28 Edited at: 6th Mar 2008 21:40
Hi,

I don't see this mentioned anywhere - perhaps I just missed it - but is there a guide or cheat sheet or something that indicates how a user plug-in is created to work with DarkGDK? Or how a DarkBASIC plug-in can be altered to work with DarkGDK?

I would like to port my ConvSEO plug-in to DarkGDK and I need to understand the differences in linking to the DarkGDK core as opposed to the way in which DarkBASIC plug-ins link to the DarkBASIC core.

If I get a pointer to how to do this I'll be happy to share the results with the community.

Regards,
Mike J

"The early bird may get the worm, but the second mouse gets the cheese."
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 6th Mar 2008 21:32
Are you Serious? What'd ya write your plug in in?

Mike J
Retired Moderator
18
Years of Service
User Offline
Joined: 7th Jul 2006
Location: Binghamton, NY, USA
Posted: 6th Mar 2008 21:39 Edited at: 6th Mar 2008 21:41
Yes, I'm serious.

I wrote it in Visual C++ 6.0.

Jason, even though your response seems a bit "hot", I will thank you for it because it told me I needed to clarify my original post, which I have now done.

"The early bird may get the worm, but the second mouse gets the cheese."
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 6th Mar 2008 22:12
But if you wrote it in C++ then you can just make a lib? or Im wrong?

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine (thanks kBessa)
Mike J
Retired Moderator
18
Years of Service
User Offline
Joined: 7th Jul 2006
Location: Binghamton, NY, USA
Posted: 6th Mar 2008 22:16 Edited at: 6th Mar 2008 22:18
When a DarkBASIC plug-in is loaded, it gets a pointer back to the DBPro core structure, through which all aspects of DBPro can then be accessed. I'm wondering what the equivalent is in DarkGDK.

Also when a plug-in is loaded, there are several queries that DBPro makes, such as what other DBPro DLLs this plug-in depends on, and so forth - so they can all be loaded automatically. Again, I am wondering what the equivalent functionality is in DarkGDK.

I guess you'll just have to take my word for it when I say that based on the way the plug-in calls functions in the standard DBP DLLs, I'm pretty sure those methods will not work in DarkGDK without some changes.

"The early bird may get the worm, but the second mouse gets the cheese."
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 6th Mar 2008 23:45
Mike J - We take your word on it. I know there are "Rules" for a plug in. I was just taken aback because its C++. I think you're going to want to do what Sparky Did, and if its a "for pay" plug in I think you'll need to add some sort of home brew licensing mechanism that doesn't work right for linking, but the DLL works unless they registered.

I would take your core code, rethink your commands into functions, and wrap your main functionality like that.

we all have found various linkning issues, and there are a few fixes but its either Google and this forum or trial and error.

so.. what does ConvSEO do?

monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 7th Mar 2008 13:25
I digress here but I just noticed your sig, made chuckle.


Quote: ""The early bird may get the worm, but the second mouse gets the cheese.""


That has changed my entire outlook on life, maybe not for the best though

Much good work is lost for the lack of a little more.
Mike J
Retired Moderator
18
Years of Service
User Offline
Joined: 7th Jul 2006
Location: Binghamton, NY, USA
Posted: 7th Mar 2008 13:46
Jason, there is an entire TGC board dedicated to ConvSEO. It is a SketchUp model importer for DBPro. I recently released the source code into the public domain for everyone here to build upon, but I have a project of my own where I would like to use it in DarkGDK, so I am now working on a conversion. If I can get it to work I may release that back to the community as well.

I appreciate your reponse... and I would love to know "what Sparky did." I think that's what I need to find out - what have other DBPRo plug-in authors done to make those plug-ins work with DarkGDK. I realize that I need to make a DLL, but I'm still stuck as far as how to link back into the toolkit and use the global structures (or something similar) that I was able to use in DBPro - which let me get pointers to internal data, and so on.

"The early bird may get the worm, but the second mouse gets the cheese."
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 7th Mar 2008 13:47
Mike, email me at mike@thegamecreators.com and I can provide assistance on how to get a plugin working. It isn't so hard. May require a few modifications to your source but once set up it's simple to work with.
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 7th Mar 2008 13:54
Mike Johnson,

Maybe this would be a good topic for one of your great tutorials like the 'Importing custom media' one that you did, work permitting of course . It would certainly help a few people out, and extend the plugins available for the GDK maybe.

Just a thought.

Much good work is lost for the lack of a little more.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Mar 2008 14:20
It isn't too difficult to convert.

IIRC, the globstruct can be accessed either via the g_pGlob variable, or via the dbGetGlobPtr() function.

Then wherever you are using GetProcAddress to fill in a function from a DLL, replace that by simply filling the function pointer from the equivalent GDK function name.

This code:


Would become this code:


or you can do a global replace to the GDK function instead.

Mike J
Retired Moderator
18
Years of Service
User Offline
Joined: 7th Jul 2006
Location: Binghamton, NY, USA
Posted: 7th Mar 2008 14:24
Thanks, IanM. I am also following up with Mike Johnson.

Regards,
Mike J

"The early bird may get the worm, but the second mouse gets the cheese."
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Mar 2008 14:57
Good Stuff. Talk about getting some great assistance!

What Sparky did and TGC did is they made lib files that people can link to, use, but not have the source code to. This sort of technique is great for programming libs with FreePascal also - you can distribute compiled "Units" and they are just like libs in that they are pulled into and become part of your executable (Or DLL if making one).

Those guys above definately know the DarkBasic plugin landscape - but I think you'll find you already know more than you're original post sounded like once you start really digging in.... I suspect you'll hit that moment of "OH....I GOT THIS!" and will be sprinting because you already have a solid code base from all accounts.

...and I didn't mean to sound "HOT" ... but I didn't mind making you go... "Hmmm"

Good Luck...
Best Regards,
Jason P Sage... an Enthusiast!

Login to post a reply

Server time is: 2024-10-08 06:39:48
Your offset time is: 2024-10-08 06:39:48