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.

DarkBASIC Professional Discussion / Make dll with GDK for DBPro

Author
Message
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Nov 2013 19:44
Hello, I've asked in the GDK forum, but though I'd post here too as it gets more traffic.

Can anyone provide a guide on how to create a DLL file using GDK, that I can use with DBPro. I'd like to convert my DBPro UI engine to an OOP language to take advantage of all the useful things, but don't know where to start. (I've never used GDK, but I want to learn.)

Can anyone here help?

Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 15th Nov 2013 12:57
I'm not sure if that is directly possible without compiling your dll to include the whole of DarkGDK - and even then your plugin and DBP program would run as two completely separate processes (ie. they wouldn't share media or anything).

You can however access the DBP functions from the other dll's loaded by your DBP program (that's why certain plugins require you to use a memblock command, etc. to force the DBP compiler to include those libraries). References to these dll's can be retrieved by the GlobStruct pointer that is sent to a dll that implements the PassCoreDataPointer (or something like that, can't remember the name off the top of my head) function. It should be somewhere in the help files.


"Why do programmers get Halloween and Christmas mixed up?"
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Nov 2013 19:25
Quote: "You can however access the DBP functions from the other dll's loaded by your DBP program"

This I understood.

Quote: "References to these dll's can be retrieved by the GlobStruct pointer that is sent to a dll that implements the PassCoreDataPointer (or something like that, can't remember the name off the top of my head) function"

This I didn't

Quote: "I'm not sure if that is directly possible without compiling your dll to include the whole of DarkGDK"

This I don't think I could do for licencing reasons, but I don't want to do this anyway.

I don't mind calling the DBPro DLL's, I just don't know how in C++. (I've never used GDK yet.)

Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 15th Nov 2013 21:43
Apparently there are three custom functions you can implement and export from your dll that will be called automatically by DBPro;




I just wrote that code up so it isn't tested, but that should be the gist of it.


"Why do programmers get Halloween and Christmas mixed up?"
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Nov 2013 23:59
So I can take this, and modify it to add support for calling the DBPro commands I'd need in my GDK code?

It's a good start. I'll have a fiddle with it when I install GDK and see if it gives me the results I'm after.

The next part would be to compile this into a dll I can call from DBPro.. (Even if it's just a wrapper for existing DBPro functions so I can see that it works.

(For example, call your MakeUnitCube in DBPro and watch a cube be made.)

Login to post a reply

Server time is: 2026-07-07 07:34:24
Your offset time is: 2026-07-07 07:34:24