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 / DBP "CAN" run openGL and DirectX at the same time! -> Proof...

Author
Message
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 13th Aug 2012 16:49
Quote: "Can I have a peek at it too to learn how you folks do such advanced stuff ? I may not be able to help much but still I want to learn if it does not hurt anybody."

If you go to the link that Aaron posted, you can browse the source code of the wrapper.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 13th Aug 2012 19:49 Edited at: 13th Aug 2012 19:51
@Seppuku
I can add you as a collaborator too. I just made WLGfx a collaborator as well.
EDIT/Question: Did you choose your alias from the story of the 47 Ronin, by chance? Or, how did you choose it?

@WLGfx
I'm trying to figure out how to make you an admin of the repository, not just a collaborator. But, you'll be able to make changes to the system, just not delete the repository or rename it.

Cheers,
Aaron

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 13th Aug 2012 20:29 Edited at: 13th Aug 2012 21:33
Quote: "
I can add you as a collaborator too. I just made WLGfx a collaborator as well."


As I say, I'm willing to give it a shot, how useful I'd be is yet to be seen, but WLGfx maintains that it's simple, so I'll take his word for it. But I'll accept, I got some free time to spare on that sort of thing.

My email address is bryn[dot]price[at]live[dot]co[dot]uk, I'll set up an account.

[edit]
Username is: BrynP

Quote: "Did you choose your alias from the story of the 47 Ronin, by chance? Or, how did you choose it?"


The fact my first project in DBP was called 'Ronin' you'd probably think that more, but it's not why I called myself Seppuku Arts. At the time I was in love with Feudal Japan and there was research/reading I did into it and I found it very interesting, hence I had game ideas surrounding it (I also read Hagakure and Book of the Five Rings (written by the guy depicted in my avatar) and loved them). I thought 'Seppuku' sounds cool and it's got a gory context to it (ritual suicide of dishonoured samurai through disembowelment) and 14/15 year old me thought that was badass and I've since had no reason to change it.

[edit 2]
The only thing I am struggling to understand with coding DLLs it seems is string tables. I can't use VC++ 2010's resource editor because I am a lowly Express user and the DBP documentation seems to have left one bit out (that I'm trying to understand) unless I missed it:
Quote: "PRINT TEXT%S%?PrintText@@YAXPAD@Z%String"

I noticed YAHXZ is used when getting a Int return. It doesn't work when I do the same thing with a string and I tried YAXPAD just for the heck of it. If it's a problem that'll hijack this thread, I'll edit this out and post a new thread in DLL Talk.

My stringtable looks like this (for getting a command that returns a string)


Cheers.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 13th Aug 2012 21:46 Edited at: 13th Aug 2012 22:03
Alrighty Seppuku, you've been added as a collaborator to the GitHub repo.

About the string table, it's actually a kind of funny thing. I'll explain it in detail though.

"?PrintText@@YAHXZ@Z" is the name of the function. That's how it looks when it's exported from MSVC. The GCC encoding is a bit simpler. "__Z9PrintTextPKc"

Why does it do this? Because you can have function overloads. For example, "int GetSum(int a, int b);" and "float GetSum(float a, float b);" If they were exported exactly by name, there would be a naming conflict, and you wouldn't be able to tell them apart, even though they're separate functions.

I normally don't use overloads when exporting. Instead I prefix with extern "C". This causes the export to occur with just the name of the function. (Some compilers prefix with a "_" and if you're using __stdcall you'll get "_func@4" or the likes. But no worries on that.)

Here's an example:


So, in your string table, you just have to reference the correct name of the function. If I glossed over a few details or you would like more help, let me know.

EDIT: Here's a complete example.

main.cpp

commands.rc

getsum.ini

GetSum.htm


(Untested.)

Cheers,
Aaron

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 13th Aug 2012 23:30 Edited at: 13th Aug 2012 23:30
Cheers. That seems like a much more desirable way of doing it. In other words, I should listen to you and not the DBP help file. I managed to get my 'Hello World' test to work at least, going to try some more experimentation.

Just flicking through the project file now, I see you've got access to a DBP header, I didn't know one was available, is there any kind of documentation for it?

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 13th Aug 2012 23:41 Edited at: 13th Aug 2012 23:41
The DBPro header files give you access via the globstruct which is grabbed when the dll initializes. From this all you need to do to use a DBP function is just DBPro::<functionname>(vars)

I included that deliberately so that we can convert meshes over from irrlicht etc...

After typing the 'DBPro::' the intelli-sense will kick in and show all the functions...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 13th Aug 2012 23:49 Edited at: 13th Aug 2012 23:50
DBP header? Are you referring to globstruct.h, or something else? The dbFloat function is one I just defined so I don't have to type *(int *)&f (which requires the use of a local variable) every time I want to return a float. This is a DBP issue, and not a general DLL-writing issue. It was mistakenly (though understandably) believed that floats would also be returned in the EAX register (assembly stuff) as opposed to on the FPU stack, where it should've been returned. Likewise, it's difficult to return strings as well. I also wrote a dbString function for just this sort of thing. I'll post it here once I find it.

The Dark Basic Pro source code (except the compiler) is available on Google Code. That's probably the best bet for readily available documentation. However, if you have any questions I'd be happy to answer them (or look into them) for you.

Also, glad I could help. Hopefully this post will be at least semi-coherent. i][/i])

EDIT: WLGfx must've posted right after I opened up this thread. xP

Cheers,
Aaron

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 13th Aug 2012 23:52
Awesome, cheers. And how are you guys appending char*s? I tried strcat but it caused an overload and strcat_s, which is supposed to prevent an overload but kept giving me an error in DBP.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 14th Aug 2012 00:04
Character pointers (raw strings) can't actually be appended to with just that. You would have to reallocate the memory chunk so that the new string will fit in the old memory. For example, imagine a box that has four apples in it, and can fit six. Imagine you want to add eight more apples to the box. You can fit an extra two in (to make six) but now you can't fit those extra six apples in the box! Oh noes! So, we just need a bigger box. Sometimes we can just cut out one of the walls and add some new walls in. That way, we can fit those extra apples. Or, we can try just grabbing a new box that'll fit and move those apples into the new box. That's how a call to realloc() works. Unfortunately, we can't simply call realloc() in this case, because it doesn't know how to deal with our "boxes." Our boxes were created with GlobStruct::CreateDeleteString(). That means we have to tell it to do so, because it's the only one that knows how to deal with our boxes. (A bit confusing, I know, but bear with me here.)

Dealing with strings in DBPro is one of the most annoying things to do. Might I suggest taking on another task as a first attempt?

[[/i]ADVANCED[i]]
This is how I manage strings in DBPro. I keep track of the memory, plug-in side. So, if I have for example a named entity in my plug-in, that entity's name is recorded with the rest of the information about that entity. Then, when I go to retrieve the information, I just return that string, like so: return dbString(oldstr, ent->name); The advantage to this approach is that it's way easier to manage.

Here's my dbString function:


Cheers,
Aaron

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 14th Aug 2012 00:15 Edited at: 14th Aug 2012 01:01
Cheers for the explanation (and the overall help).

Quote: "
Dealing with strings in DBPro is one of the most annoying things to do. Might I suggest taking on another task as a first attempt?"


I'll do that. Trust me to complicate things first.

[edit]

I'll try out more tomorrow and will post a thread over in DLL Talk if I get stuck some more. I did have trouble using DBP commands earlier, but I'll see if I can figure out the problem tomorrow before asking for help.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th Aug 2012 04:44 Edited at: 14th Aug 2012 05:00
DBPro::CreateDeleteString & CastFloatToDword

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th Aug 2012 05:56
From tomorrow I'll alter the first post to this thread for anyone first visiting. That is after I've written some simple examples on how to use the DarkIrrlicht project. Anyone got a DarkIrrlicht logo?

For DBP users, although there's no setup, all you need to know how to do is, to copy the dll and the ini files into Dark Basic Pro directories. And that's it. Eventually, and maybe along the way, help files will be produced. I'm not good at writing documentation but I will this time make an attempt.

The latest update so far includes the IMeshBuffer class which gives the coder access to hardware mesh buffers.

When I wake up tomorrow I'll make all the adjustments to the first post, hopefully with a logo too...

Originally this was just a test to see if I could run DBPro at the same time as an openGL application from the same exe file. It then went from the test being faster than the original engine in 'some' ways to it being bigger. Then it got serious. Although, and I agree, there have been reservations about the idea and its progress, it became something else.

And that my friends, is open source DarkIrrlicht.

Object Orientated Programming Application Interface 'for' Dark Basic Professional.

There will be many thanks to give for this project which I will give when I do my write up tomorrow but for now, I think it's time for bo bo's...

ZZzz..'s (WLGfx)

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Aug 2012 08:38


Any good?

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 14th Aug 2012 09:17 Edited at: 14th Aug 2012 09:32
Quote: "Eventually, and maybe along the way, help files will be produced. I'm not good at writing documentation but I will this time make an attempt."


I'll make an attempt with the current project and maybe even create a template, it should be too difficult as iirlicht documentation already exists.

Quote: "That is after I've written some simple examples on how to use the DarkIrrlicht project."


I think that'll be handy and maybe some notes on set up. I've done all of the includes and libs, but still have trouble compiling, I feel like I've missed something, but I'll post that problem when I'm back later. Mind you, I see you guys are using the 64 bit includes for Irrlicht and I've used the 32bit one, so I don't know if that is why, I wouldn't have thought it'd be the cause,

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 14th Aug 2012 09:50
@MrValentine
That's great but I'd recommend two things if you don't mind.
(1) Instead of "Object Oriented Programming Application Interface 'For' Dark Basic Professional" it should be either "Object Oriented Application Programming Interface For Dark Basic Professional" or "High Performance Rendering For Dark Basic Professional."
(2) The Irr and Licht would look really good as two separate colors. e.g., Dark is black, Irr is a really dark purple, and Licht is a really dark grey (e.g., charcoal or the likes).

I like the image a lot though.

Cheers,
Aaron

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Aug 2012 09:51
Thanks for the feedback, I just copied what WLGfx wrote...

will have to wait until he gets back to confirm that...

will make the changes now hang on...

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Aug 2012 09:59 Edited at: 14th Aug 2012 10:00
hows this? see previous post... [containing the image...]

EDIT

I have the order you mentioned also just want feedback on this version for now

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 14th Aug 2012 10:54
I like it! But perhaps remove the quotations from "for" as that seems a bit off in a logo to me. Good job.

Cheers,
Aaron

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Aug 2012 10:56
done, and again thanks just waiting on WLGfx to wakey wakey

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 14th Aug 2012 12:27
It's 10:25am and he's not awake, I know he's a Northerner, but I didn't think they were that lazy.

Joking aside. The logo looks great. So for documentation, what would work - direct translation of the Irrlicht documentation but specific to DBP complete with an example and in the format of the DBPro help files? What I think would be cool is to relate them to DBP commands or have examples demonstrating the equivalent so a DBP user can understand what they mean without reading walls of text. (Personally, I hate that, I prefer a simple explanation, if it's a bit more complicated, have an example and learn the rest by doing).

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Aug 2012 12:34
Thanks Sepp, haha I too am a northerner s I stand proud to have such an positive image >.<

I get up around 5-6am everyday now...

I made the domensions fit the forum requirements...

I am curious about the documentation... can I attempt it?

Would be ace if I could... HTML and PDF versions... I can do... would be interesting to learn CHM but they are so restrictive I find... I would rather just keep it as HTML and PDF... personally...

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 14th Aug 2012 13:28
Quote: "Thanks Sepp, haha I too am a northerner s I stand proud to have such an positive image >.<
"


Haha. If I don't have to get up early (like this morning), I could easily exceed the the 10:30 am mark, so I'd hardly be one to complain.


Quote: "
Would be ace if I could... HTML and PDF versions... I can do... would be interesting to learn CHM but they are so restrictive I find... I would rather just keep it as HTML and PDF... personally..."


I might do them as a PDF & HTML, heck, as I'd be using Publisher 2010, there's an array of file formats I could export to should anybody need it. I could add .doc and .docx should anybody prefer them too and I'd still retain most of the formatting (some formatting you can do in Publisher won't work in Word as I found out when an employer asked for my CV as a .doc instead of a .pdf)

But as it's all open source, so I don't see why you couldn't contribute with documentation. All of the commands and their irrlicht equivalent are actually stored in a spreadsheet within the project folder. Obviously it's WGLfx project, so I don't want to sound like I'm speaking on his behalf, but if it's open source, that's my understanding.

I think, if my attempt at getting DLL coding done fails, I think my contribution would best be suited to documentation,either way I think it's a great project idea so naturally I'm happy to be useful wherever I can be useful. If you wanted to do some documentation, perhaps the 2 of us could liase, you've got my email address (if you've lost it, it's a few posts up).

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Aug 2012 13:33
Quote: "All of the commands and their irrlicht equivalent are actually stored in a spreadsheet within the project folder. "


I wonder how that one came about >.<

Quote: "(if you've lost it, it's a few posts up)."


Don't put your email in these pages... not a good idea... but then again I think the profiles are easily accessed too...

I suppose one of us could do the web / HTML version and the other the local PDF editions



Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 14th Aug 2012 14:02 Edited at: 14th Aug 2012 14:03
I put the [at] and [dot] in my email addresses so spam bots don't get me and my email address is publicly available should anybody wish to contact me (like LinkedIn and Reed so potential employers can contact me), just not in my TGC profile. I am not stupid enough to fool for scams at least.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th Aug 2012 14:18
A lazy Northener! Ha ha ha... Thanks Sepp... I needed that...

Last night I had a couple of beers and went bed quite early for a change. Usually I'm still up burning the midnight oil, and sometimes til gone 4am too. Not yet thought of what to add to the top post yet, might wait til I've got some examples now that the animated meshes work 100%.

The logo is very cool, thanks MrValentine. Ace.

The original doc was so that the dll may possibly be open for other wrappers so I left the original functions in it. But for the DBP docs, the html format would prob be the best because then it could be integrated into the normal help files. And can also be accessed locally.

I know it started out with me creating this project but anyone who contributes to it can can take credit for it too.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Aug 2012 15:08
Me = Super happy today even though I just blew my ear drums up

Sepp you could still do a PDF version of the files, which would help me to shape the HTML better...

Or can you handle HTML too?

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 14th Aug 2012 15:43
I'll be using Publisher and that exports both, so in theory, yes. But any help is appreciated.

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Aug 2012 15:48
OkiDoki

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th Aug 2012 16:04
@Aaron Miller - Loving the new relative paths in the projects.

Irrlicht is very good because of the comments in the source code. The same goes when you load up the original source code if you're re-compiling the library...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 16th Aug 2012 01:22 Edited at: 16th Aug 2012 01:22
Thought I'd get some kind of concept out for the documentation (pdf attrached) - not tried to pretty it up or go for any real design. Probably white on black is a good idea - seemed like a good one when I wrote it (emphasis on dark) but may be a poor design choice.

But I've sectioned it out like this:
Commands | Tutorials | Examples | Principles

Commands - basically telling you what they do, explaining them and showing their return value/types and an example of usage. I've also put in a DBP command to compare it to, for ease of use with any DBP.

Tutorials - If we make any, I'll stick them in there.

Examples - Project examples rather than usage examples. So complete demos

Principles - Explanations of Dark Irrlicht principles to help ease the transition from Dark Basic Pro commands to Irrlicht ones.

I've got samples of a couple of commands and a principles page. But anybody wishing to contribute with the documentation, then you'll be able to know what I'm expecting. I am open to suggestions - except on the design, because I'm not worried about that yet.

Attachments

Login to view attachments
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Aug 2012 02:47
Oooh... I like it a lot... Nice looking...

I've changed the "IRR BEGIN SCENE a,r,g,b" to "IRR BEGIN SCENE color"

It'll get there this API.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 16th Aug 2012 05:03
I'd recommend Doxygen for easy generation of documentation, especially in C++. You can set up a configuration file for everyone to use, and it exports to HTML or LaTeX IIRC.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 16th Aug 2012 07:25
Dar13, do you know of a method to get Doxygen to spit out documentation in a custom syntax (i.e., DBPro)? That's the only issue I see with the Doxygen approach. I usually spend most of my time wrestling with Doxygen though. (I once even wrote my own crude document generator because of nuances regarding Doxygen, lol!)

Nice to see progress on this. I've been a bit busy lately, but I've been kicking around a few ideas in my head.

There should be a TODO list in the project repo if there isn't already. That way it'll be easy to see what needs to be added next.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Aug 2012 13:25
On the front document of the Git repo there could be a list of what's being done. ie. I'm going to add the Irrlicht Vector3d library next.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 16th Aug 2012 13:54
Question, how do I actually get the project to compile? I've downloaded the latest. Found it needed includes for DirectX SDK & a lib for Irrlicht 32bit (as you guys had it set up for 64bit) and I get this error:

Quote: "1>------ Build started: Project: DarkIrrlicht, Configuration: Debug-Main Win32 ------
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1> Creating library C:\Users\Bryn\Desktop\AaronMiller-DarkIrrlicht-63d9f8c\DarkIrrlicht\Debug-Main\DarkIrrlicht.lib and object C:\Users\Bryn\Desktop\AaronMiller-DarkIrrlicht-63d9f8c\DarkIrrlicht\Debug-Main\DarkIrrlicht.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>DBProInterface9.0.lib(Matrix1Util_04.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
1>DBProInterface9.0.lib(Core.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
1>LIBCMTD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
1>C:\Users\Bryn\Desktop\AaronMiller-DarkIrrlicht-63d9f8c\DarkIrrlicht\Debug-Main\DarkIrrlicht.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped =========="


Quote: " On the front document of the Git repo there could be a list of what's being done. ie. I'm going to add the Irrlicht Vector3d library next."


Might be a cool idea. I could do the same with the documentation. I am going to continue working with documenting 'iscn'. Also, what might be useful is for each update just to have an 'update' file with a date to say what changes/additions have been made. Documentation wide, it should help with updating commands and of course, programming wise, we know how up-to-date our current project is before submitting new additions.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Aug 2012 14:10
The irrlicht lib isn't included in the source. You have to load up the source for Irrlicht and compile it as a static lib - fast fpu. I think the paths are already setup for the DX9 SDK though. If not then you will have to set them to point to the include and the lib\x86 dirs...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 16th Aug 2012 16:22
@Aaron Miller, you could put the DBP version of the function in the \brief tag of the function.

Here's a quick example that I've whipped up.

Attachments

Login to view attachments
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 16th Aug 2012 18:15
Irrlicht for Basic is a cool idea, has it been done anywhere before?

Are functions returning structs? It looks like they are. It may be a bit late now but keeping in the spirit and ease of use for beginners, should the whole thing not use ID numbers instead? Has anyone thought about this?

If this gets finished then it could be very useful for a lot of people, I hope it finds its way to people on a large scale and not just forgotten, confined to a forum post

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 16th Aug 2012 18:30 Edited at: 16th Aug 2012 18:33
What it is doing is actually pretty simple, in my documentation I offered an explanation for it, so regular DBP users can understand. The way I compared it? Some people who use Dark Basic Pro might use code like this:

player = 1
make object cube player, 30

In Dark Irrlicht, this is the equivalent

player = iscn add cube node (0, 30)

So I don't think the transition would be that difficult if people thought of it in that way. Okay, 'player' is just an integer in the first example and the second is a type of node, but as DBP has different types of id numbers (camera, object, light, shader...) it's the same for nodes in irrlicht. I don't think it'd be too hard for a DBP user to grasp.

The aim of my documentation is to try and make it easy for beginners, but prolly requires some familiarity with DBP first.

Personally speaking? I like the idea of not using ID numbers. It's why I love using freeObject() commands in DBP & Dark GDK.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Aug 2012 18:31
There have been other language bindings for Irrlicht and the closest was probably Free Basic. I've not tried it but it does look impressive for what it is.

This DarkIrrlicht wrapper returns pointers to either classes or node structures so when using those pointers they just get past along with the next functions. So a bit of un-careful programming can cause a crash that I've already found out already. I actually find it easier using a named variable or something similar than using ID's but I think that's down to taste really.

So far, my tests comparing the Irrlicht library with DBP's built in engine, both using DX9 gives me a 25% speed boost. I will add some more comparison code bit by bit as I go along which benchmarks or showcases the wrapper... Although the openGL is faster on my laptop it is also slower on others computers, but deffo the DX9 is faster.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 16th Aug 2012 20:00
Okay, I'm going to have to edit the project settings again because there shouldn't be a direct reference to the DirectX SDK in there. (The reason being that it's unnecessary and a different version can be used. Additionally, it makes it difficult to compile if your program files aren't on your C drive.)

Here's a brief tutorial on how to add the DirectX SDK to your global include path, as opposed to the project's include path.

Step 1: Enable the Expert Settings
Go to Tools -> Settings, then click "Expert Settings."


Step 2: Display the Property Manager window
Go to View -> Property Manager.

Step 3: Locate the global properties
Inside of the Property Manager you will see multiple items like "Debug | Win32," "Release | Win32," etc. Expand any of these tree-items (I open "Debug | Win32"). Then find the property sheet titled "Microsoft.Cpp.Win32.User," and double-click it.


Step 4: Add the DirectX SDK to your global paths
Include and lib.


Hope that helps.

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 16th Aug 2012 20:48
Cheers. I'll give it a go later. I could include that in the help file should anybody wish to know how in the future, so they can contribute to the project.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 16th Aug 2012 23:30
Quote: "Personally speaking? I like the idea of not using ID numbers. It's why I love using freeObject() commands in DBP & Dark GDK."


I agree, I hate ID numbers, they are the source of many possible bugs as projects scale up.

Quote: "This DarkIrrlicht wrapper returns pointers to either classes or node structures so when using those pointers they just get past along with the next functions. So a bit of un-careful programming can cause a crash that I've already found out already. I actually find it easier using a named variable or something similar than using ID's but I think that's down to taste really."


That's cool, and more efficient than ID numbers I would think.

That said, I think you should add some checking mechanism to be sure the correct pointers are being passed. Perhaps objects of each class should hold a string to hold the name of the class it belongs, or something along those lines? Each function could then do a check it has a pointer to an object of the correct class before continuing. It may be a little more complex than that if we take inheritance into consideration, not sure, have not thought it through

Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 17th Aug 2012 03:53
Quote: "That said, I think you should add some checking mechanism to be sure the correct pointers are being passed. Perhaps objects of each class should hold a string to hold the name of the class it belongs, or something along those lines? Each function could then do a check it has a pointer to an object of the correct class before continuing. It may be a little more complex than that if we take inheritance into consideration, not sure, have not thought it through"

Perhaps an enumerated value instead of a string. Adding a string comparison to every function call could hurt performance.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 17th Aug 2012 04:17
I'm starting to think that this should consist of a utility that parses the Irrlicht files for interfaces and their methods and outputs the raw versions of those functions, as well as updates the keywords list and resources list. Special functions (like IRR DROP and friends) could exist in their own files still and be custom-coded (and therefore not as automated). That way, new Irrlicht versions (with entirely new APIs) would be easy to support, updating the keywords and resources file won't be a chore, and more can be done faster. The down-side of course is the extra time it would take to develop said tool and put it together. But, tbh, it wouldn't be that difficult and is probably more worth doing than tediously nabbing each command, adding the calls, etc.

As for proper naming, that's easy to manage thanks to Irrlicht's naming conventions. "ISomething::doStuffAndThings" -> "ISMTHNG DO STUFF AND THINGS." For custom names for the classes, a text document containing translations could exist.


Maybe I'll work on that.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 18th Aug 2012 01:14
Added a few more items to the project and also a major animation fix added. Just add IDEV TIMER TICK before the BEGIN SCENE.

Project attached for testing out. So far I still get a 25% increase over the DBP rendering engine.

Code used in the test:



Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Attachments

Login to view attachments
Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 18th Aug 2012 02:12
Cool. I figure I might be more help with the documentation/examples/tutorials than the actual coding, I think I'm too much of a C++ newb, might continue to experiment, but I figure sticking to documentation would be more productive. At the moment I am working in C# to create a start up project (which I'll convert over to Dark Irrlicht). It'll be a simple project just to help folk get started with many of the commands they'll need to code a game using Dark Irrlicht.

On the demo
240 - 250 fps for DBP
250 - 260fps for Irrlicht Direct X
270 for Irrlicht Open GL

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 18th Aug 2012 02:51
I've altered the ini file to show in the DBP IDE the return values now too. It might even help out with the documentation. I'm also expecting the addition of Irrlicht's vector3df wrapper (currently using the IVEC3 command set and single precision floats) to be faster than DBP. Eventually it will have all the matrix and quaternion stuff, whatever they do I don't know yet.

Not sure what to start on next though. There seems to be soooo many GUI commands built into the Irrlicht engine so I might just skip them for the time being. Although I do need to add more input events.

There's enough to the wrapper at the moment to transfer images and textures between the two API's. I think the next step might be more work on the mesh buffers so that mesh data and animated mesh data can be transferred too.

The Irrlicht website has tons of examples which I think I'll need to make sure can run from DBP.

@Sepp - Currently there's 279 commands and it looks like I've not touched the Irrlicht engine hardly yet. Maybe grouping the commands together in the documentation might be better.

Once a few examples and tutorials are done, then the first post can be updated properly as at the moment it's still early days.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 22nd Aug 2012 09:27
I haven't had much time to work toward anything on this as I've been focused on other things. The thought for the tool was just a thought, but it'd be a lot of work to get implemented. (If it were implemented, it would be quite helpful!)

Before anything else gets done on this, has anyone seen Horde 3D? That might be a bit easier to get working. It only renders via OpenGL AFAIK, but it looks a bit more "featureful" than Irrlicht. (I like Irrlicht's API a bit more though.) Just something to evaluate.

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 22nd Aug 2012 12:02
That might be a good idea. Looking at the syntax it seems procedural, just like DBP and looks like it might be simple to use (ideal for a DBP dude). I'll give it a download and see how simple it is to use with C++. Whatever is used and should this project continue, I am happy to write documentation/tutorials. Maybe eventually my DLL coding skills will be up to scratch, we'll see.

Login to post a reply

Server time is: 2024-04-28 02:56:45
Your offset time is: 2024-04-28 02:56:45