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.

Program Announcements / C++ Interface Library

Author
Message
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Jul 2004 11:01
I've just completed work on the Interface library for 5.4.

Changes include:
- Rewritten/reorganised the headers
- Broken it all out into separate downloads (1 for headers, and 1 for each compiler library)
- Added a few helper functions
- Added some experimental functions for creating/updating checklists within your own DLLs
- I've also increased the level of documentation slightly with regard to all the extra functions that have been added.

There are a few other bits too, but you can find details in the readme.

Unfortunately, I've had to remove the Vertex manipulation functions, due to the fact that they don't work any more

If you look hard enough, you might spot a few currently undocumented commands in there

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 8th Jul 2004 12:09
I didn't catch your first post on this( ), could you describe what this interface does?

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 8th Jul 2004 12:22
it allows you to call native DBPro commands (such as load object) directly from C/C++.

I'll have to download this new version, and update my Newton Wrapper!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 8th Jul 2004 12:37
I'd really like to know what TGC have done to those vertex commands as they were working fine before 5.4; Don't even know why they weren't actually released already.

BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 8th Jul 2004 13:33
Awesome!
Could I use this with a linux emulator like djgpp?

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Jul 2004 20:29
No.

Firstly, DJGPP is a DOS compiler, not an emulator.
Secondly, this has nothing to do with linux - it just makes all the DBPro commands (+ a few others) available to C++ coders.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 8th Jul 2004 21:11
I'll have to get that later on - see if it affects Sensitive


Are you sensitive enough?
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 9th Jul 2004 12:34
I offer my humble apologies for demonstrating my lack of knowledge of C++, I'm just starting to learn. But that aside, this is the greatest idea, I regret not checking the Program Announcements in the past.

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 9th Jul 2004 16:10
I've just worked out how to use it! Yey!!! One thing still evades my logic: the stringtable name. What the hell is all that jibberish? I looked in the DBPro help file about writing DLL's, but I just don't understand it. Could any of you lot tell me how to figure it out? Or maybe a link to somewhere that gives the answer?

Cheers for the great interface!

Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Jul 2004 22:06
You can find the basic breakdown of the resource string here : http://forum.thegamecreators.com/?m=forum_view&t=34810&b=1&p=0

You can get the function name from your DLL by opening it up using wordpad as explained in the TPC help file.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Jul 2004 00:50
The jibberish is exporting the functions as C++ Named Symbols...
DBP doesn't actualy need that...
by prototyping any functions you make like so:



rather than like this:



you can create the strng table using the function name instead of all the crap before and after it:

ie

My Function%0%MyFunction

instead of

My Function%0%?MyFunctionX@@YA (just an example isn't correct)

eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 10th Jul 2004 05:42
So just to get this straight, If I use the following code, the function should return 45.



Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 10th Jul 2004 05:51
yes


Are you sensitive enough?
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 10th Jul 2004 06:15
Just compiled it and it didn't work. Had to debug it. Came up with this in the source file:


and this in the .rc file:



I put the dll into the plugins-user area and compiled the following DBPro source:



However, it came up with a 0 on the screen. My head hurts (or, given the fact that it's due to a computer, hertz)

Anyone?

NB. I'm using Dev-C++

Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 10th Jul 2004 06:18 Edited at: 10th Jul 2004 06:18
print mytest()?

'mytest' is just being interpreted as a variable I think.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Jul 2004 06:19
The resource string should be 'mytest[%L%hello', and your DBPro code should be 'print mytest()'

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 10th Jul 2004 06:21 Edited at: 10th Jul 2004 06:26
@ DavidT
Just compiled it and said that the variable doesn't exist. This means that it thinks I'm trying to access an array called mytest() that hasn't been created.

Silly computer...

[edit] you posted while I was typing, IanM

Although I see that this has corrected one bug, it seems that another still lurks within my code. The same thing hppens as before
[/edit]

Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 10th Jul 2004 06:31 Edited at: 10th Jul 2004 06:36
This is what I put in the source file:



and this is what I put in the .rc (ie. resource) file:



Have changed it now so that there are no parameters, and nothing is returned. It just uses IanM's library to do a "Text" command on screen.

When I run the following code, it says that it couldn't understand the command:



I'm tired

Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Jul 2004 06:35
Err ... you could try giving DBPro the correct function name to call



Remember: The first parameter is the DBPro command name, the third is the name of the DLL function to call

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 10th Jul 2004 06:40 Edited at: 10th Jul 2004 06:41
Still doesn't work.

i hate it when there are more than 1 bugs to fix. You never know if what you've just done actually made a difference.

Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 10th Jul 2004 23:38
Got it to work!!

It turns out thatI needed to include the .rc file into the compilation through the project settings, sa opposed to using the "#include" command.

Cheers for all your help guys!

Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Jul 2004 09:24
Sheesh! ... and I included instructions for that too

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 11th Jul 2004 09:54
hehee, well you don't need the entire function in the External routine; but doesn't matter

think definately reading through ian's help will be, erm, helpful

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 13th Jul 2004 04:39
It works well, Ian...


Are you sensitive enough?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Jul 2004 08:29
Uh, what does? The whole library, or the new additions?

I've had to make a few changes to the library generator to support the next set of changes in the library. Hopefully, I'll have a whole load of new stuff added to the next release.

It might be for 5.5, but I'll have to get an idea of the release timetable for updates from Mike first.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 14th Jul 2004 23:45
This has been very helpful

And, surprisingly, very easy to use too.

Just included it and I was away, weeeeee

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 15th Jul 2004 00:11 Edited at: 15th Jul 2004 00:11
The whole library...


Are you sensitive enough?
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 15th Jul 2004 00:17
Wow - my first ever TPC that interfaces now works

object distance (object 1, object 2)

yay I'm now going to do a whole load for position object at object etc.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Jul 2004 21:25
Do i need to intalization directx or any other api for these to work or is that all done for me?

hope this makes sense

Surreal Studio IanG
21
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Cyberspace...I think
Posted: 26th Jul 2004 21:42
you will need directx i think

PC Spec- AMD Athlon 2.0Ghz, GeForce FX5200 128mb, 512MB of ram, Win XP Home SP1

Error 0 = no error - how is this an error the???
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Jul 2004 21:47
You need to have the DX9 SDK installed to compile with the interface library, but you don't need to actually do any DirectX initialisation, or in fact use any DX calls at all.

For Visual Studio, install the Microsoft SDK.
For Dev-C++, use the update program available with version 4.9.8.10 to install the DX9 SDK

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 26th Jul 2004 21:48
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 1st Aug 2004 04:23
why isn't this a sticky?

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 19th Aug 2004 22:03 Edited at: 19th Aug 2004 22:04
Ian,

How fully supported is the save object command? What formats does it use? Will it save all texture data, so I can place the saved object with all relevant textures in a folder and it'll load just as it did in DBP?

Reason I ask is that for my editor I've got a collection object objejcts that'll eventually be merged into one object, fully textured. Can I then use SaveObject on that and it'll load correctly?

thanks

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Aug 2004 04:29
I've no idea. I tested it originally when I added it, but I haven't had a need to try it since then. You'll need to try it yourself I'm afraid.

-----------------------------------------------------------------------

Just a general note to those using Dev-C++.

The latest version of Dev-C++ (4.9.9.0) does not work with the current interface library. I'm working on a solution, but if I don't get one I will only be supporting one of them (most probably the newer version). More news later.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 20th Aug 2004 06:01 Edited at: 20th Aug 2004 06:09
[post moved over to the thread in the general forum]


Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
Sam Wright
Macrosii
20
Years of Service
User Offline
Joined: 31st Mar 2004
Location: Essex, UK
Posted: 2nd Sep 2004 01:37
Ian

How easy would it be to add support for a third party DLL such as Wolfs upcoming EzrotateEnhanced ?

Thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Sep 2004 02:26
Fairly easy, but only if he agreed to it.

I already plan to add the current version of Robs Gui plug-in and maybe a few of my own for the next version. Wolfs stuff would be just a bit more of the same.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 2nd Sep 2004 04:00
That would be cool.
I've sent you an e-mail though with some more info before you do.

WOLF

EZrotate!
Tokamak Physics Wrapper!
Macrosii
20
Years of Service
User Offline
Joined: 31st Mar 2004
Location: Essex, UK
Posted: 2nd Sep 2004 18:00
Thanks guys that's great.
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 3rd Sep 2004 03:21
Hows about some "load dll" kind of functions. Would that be possible? It would be very useful.

Cheers!


[href]Checkpoint Router[/href]: My AI Routing Program
Sam Wright
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Sep 2004 18:59
No the dll ones were removed from the lib.

Am I right in saying that DBPro acheives having different numbers of parameters for functions (eg. position camera x,y,z and position camera number,x,y,z) by hvaing two stringtable entries?

So I can write a dll with the stringtable:

LOAD_OBJECT%SLL%LOAD OBJECT
(3 params rather than the two)

and that will be called if I do

load object "object.x",1,1

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 3rd Sep 2004 20:02
Load DLL is just the equivilient of LoadLibrary
Call Dll is just the equivilient of GetProcAddress and jumping to the function address...
Doing it the proper API way would be quicker than having a wrapper around the API functions...

So, I use somthing like the following in my C programs :

handle=LoadLibrary("speech.dll")
say=(FARPROC &)(handle,"say");

(say)("Test of speech");


Come to the UK Convention on the 23rd & 24th of October
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 4th Sep 2004 00:24
@David T, yeah you can do that, you can do as much as you'd like



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 5th Sep 2004 23:33
You can also change one of the parameters to something else, effectively overloading the command.


"Computers are useless they can only give you answers."
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 6th Sep 2004 00:42
Nice, I plan on making my own debug vresions of commands.

So by adding a ,1 to the end of the command checks to see if it exists and if it doesn't tells me the path of the model I tried to load

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 6th Sep 2004 16:58
Good thinking.


"Computers are useless they can only give you answers."
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Sep 2004 06:01 Edited at: 7th Sep 2004 06:02
@eat much pie,
I removed those commands for three reasons ...

1 - You can do better with the commands details by TCA
2 - There were duplicates between commands - some returning a value, some not (can't overload on return values in C++)
3 - Can't have an unknown type in C++

@DavidT,
Check out my utility plug-in. There are MIN/MAX functions for all types that rely on DBPros overloading behaviour. You can even overload on return type, although this is probably not the safest thing to do as it would make things a little unpredictable

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 7th Sep 2004 06:16
Ian: Okay I will.

I'll also add a version of ink that doesn't require that annoying 2nd param

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"

Login to post a reply

Server time is: 2024-11-22 01:48:51
Your offset time is: 2024-11-22 01:48:51