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 / Can I create a dll file that uses other third party libraries in c++ and access those custom functions from dark basic pro ?

Author
Message
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 15th Mar 2012 00:48
Hello,

Can I create a dll file that uses other third party libraries in c++ and access those custom functions from dark basic pro ?

Suppose I create a dll containing some custom functions in C++ that uses other third party libraries (API) like DirectX, PhysX etc. and call these functions from within dark basic pro ? Will there be any conflict with the existing lighting and physics in the dark basic pro default engine ?

Please clarify.

Thanks,
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 15th Mar 2012 13:29
Nobody ? Nobody can not confirm if this is possible or not ? Please advice if somebody do know.
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 15th Mar 2012 15:00 Edited at: 15th Mar 2012 15:01
It is a good idea to use external dll - you just load dll and have nice and fast extra commands. Like Sparky's collision dll (search for it on forum)
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Mar 2012 16:08
Yes you can. To avoid conflict give your commands a unique prefix.

For example Dark Physics uses a prefix of "PHY" for it's commands.

A new PhysX plugin is in progress already called Dark Dynamix. It's designed to be a better replacement for Dark Physics which is an older and unsupported PhysX plugin.

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 15th Mar 2012 17:29
Hello mrHandy and baxslash,

Thank you for your replies. Can you confirm one more thing - say I am using lights related commands that comes with dark basic pro and then I create a custom dll with functions to enhance the lighting a bit further by calling directx/direct3d API functions from within the custom dll, will this interfere with the existing lighting (implemented using dark basic pro commands) ?

Secondly I see that dbpro is using certain things such as "Object Number", "Mesh Number" etc. in their commands. Say I want to create a special texturing function within my dll which when called will apply a graphic image to a particular mesh or object in the scene.
Now my question is how do I tell the function on which object/mesh to apply the texture , because directx API won't understand object no/mesh no etc. as used in dark basic commands. To be more concise - how do I pass the object/mesh instance to the function as a parameter so that the function can work on that mesh/object ?

Thanks,
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Mar 2012 17:35
Any further questions you have would probably get a more knowledgeable response on the "DLL" forum here: http://forum.thegamecreators.com/?m=forum_read&i=18

I'm afraid my knowledge extends about as far as "Yes you can". I don't know much about the details of "how". Sorry!

Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 15th Mar 2012 20:03
Quote: "will this interfere with the existing lighting"

probably not but i'm not sure (it probably depends what exactly are you going to do)

Quote: "Secondly I see that dbpro is using certain things such as "Object Number", "Mesh Number" etc. in their commands. Say I want to create a special texturing function within my dll which when called will apply a graphic image to a particular mesh or object in the scene.
Now my question is how do I tell the function on which object/mesh to apply the texture , because directx API won't understand object no/mesh no etc."

you can't use directx functions which operate on mesh basis because dx mesh and dbpro mesh are 2 different things. You can however convert dbpro mesh to dx mesh, aplly what you want and then convert it back.
As for textures, for proper texturing you will probably have to use dbpro built in functions for texturing limbs/objects. You can, of course, change texture pointer of already textured object

Quote: "To be more concise - how do I pass the object/mesh instance to the function as a parameter so that the function can work on that mesh/object ?
"

There is a function that takes object number as parameter and returns the pointer to the object structure that holds all the object data

Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 15th Mar 2012 23:27
Hello,

Thank you "baxslash" for pointing out the thread to me. I will post further questions regarding this dll coding thing there.

And "Brendy boy" , thank you too for throwing light to my queries and showing me the way to do it. I will further research on your directed path to get my dll code working.

I thank both of you once again for helping me out.

Thanks and regards,
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 16th Mar 2012 16:14
Dll for lighting? Hmm. If it is not shadow baking i'd strongly recommend to use shaders for lighting.
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 17th Mar 2012 00:09
Hello mrHandy,

Thank you for your advice. I was actually thinking of how to implement per pixel lighting and dynamic soft shadows. I guess they can be done using shaders instead like you said.

Thanks,
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 17th Mar 2012 08:12 Edited at: 17th Mar 2012 08:14
Good, then you should search this forum for Ultimate Shader Pack (aka free community shader pack). There are shaders for lighting, shadowing and more. Use "learn to write shaders" thread to get help of tweaking shaders.
Juggernaut
14
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 17th Mar 2012 16:13
OK mrHandy, I am on it.....

Login to post a reply

Server time is: 2026-07-09 00:07:45
Your offset time is: 2026-07-09 00:07:45