Horde3D

Next-Generation Graphics Engine
It is currently 23.11.2024, 18:36

All times are UTC + 1 hour




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Bindings for D
PostPosted: 21.10.2007, 19:29 
Offline

Joined: 21.10.2007, 19:10
Posts: 5
Location: Almaty, Kazakhstan
Hi!

First of all, thanks for the engine. It's neat and sweet :).

Recently, I've made bindings for the D programming language.
D isn't capable of interfacing C++ directly, but interfacing C is simple. So the only thing bindings lack is NodeAttachment class. Of course, I could write glue that would expose C interface instead of C++ class, but maybe there's a better solution?

I wonder where should I submit my work?

PS: If you're curious what the heck D is, please check this out.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 22.10.2007, 18:04 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Hi Dima-san,

thanks, great to see that there is a port for another language! I have for the first time heard of D some time ago and must say that it looks quite interesting. But of course it will still take some time to evolve and get popular.

The small NodeAttachment class is something that breaks the interface a bit. I have some ideas to make this functionality also available with the pure C interface so I think it is better to wait until I have the new functions or someone really needs it.

Until now people have usually hosted their projects themselves. If that's not possible in your case you could send me the files and I will upload them to my server. An attachment function for the forums would probably be a nice solution for the future. This should be included in the hopefully soon to be released phpbb 3.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 29.10.2007, 01:57 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
The D bindings are available from this link:

http://www.nextgen-engine.net/community/D_bindings.zip


Thanks again for contributing this!


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 14.04.2008, 16:28 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
Hi,

I've updated / rewritten the D bindings for Horde3D 1.0.0 Beta1. You can download them under
https://server1.noeding.net/d/horde3d-D_1.0.0_Beta1.zip
In the zip archive are:
  1. Derelict bindings for Horde3D
  2. converter script which "parses" the C++ bindings to generate the D files
  3. Derelict bindings for GLFW, from http://odefu.blogspot.com/2008/04/glfw-derelictified.html
  4. Knight sample directly ported to D (uses Tango, but Phobos support should be trivial); compile with version=Tango

I have tested it under Linux (64bit) using rebuild and gdc. I hope that it just works under Windows.
For Linux you have to make three small changes to Horde3D:
Code:
--- Source/Shared/utPlatform.h.old      2008-04-14 17:13:25.000000000 +0200
+++ Source/Shared/utPlatform.h  2008-04-14 17:12:29.000000000 +0200
@@ -43,7 +43,7 @@
 #      ifdef PLATFORM_WIN
 #              define DLLEXP extern "C" __declspec( dllexport )
 #      else
-#              define DLLEXP
+#              define DLLEXP extern "C"
 #      endif
 #endif

Code:
--- Bindings/C++/Horde3D.h.old  2008-04-14 17:15:39.000000000 +0200
+++ Bindings/C++/Horde3D.h      2008-04-14 01:16:58.000000000 +0200
@@ -30,7 +30,7 @@
 #      if defined( WIN32 ) || defined( _WINDOWS )
 #              define DLL extern "C" __declspec( dllimport )
 #      else
-#              define DLL
+#              define DLL extern "C"
 #      endif
 #endif

Code:
--- Bindings/C++/Horde3DUtils.h.old     2008-04-14 17:15:44.000000000 +0200
+++ Bindings/C++/Horde3DUtils.h 2008-04-14 17:15:17.000000000 +0200
@@ -32,7 +32,7 @@
 #      if defined( WIN32 ) || defined( _WINDOWS )
 #              define DLL extern "C" __declspec( dllimport )
 #      else
-#              define DLL
+#              define DLL extern "C"
 #      endif
 #endif

These patches just enable extern "C" linking under Linux.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 14.04.2008, 16:36 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
Codepoet wrote:
These patches just enable extern "C" linking under Linux.
Were there no troubles with that? We had some C++ only enum declarations a while ago.

Good to see the D support being maintained, I have always been fond of D.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 14.04.2008, 17:53 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
swiftcoder wrote:
Codepoet wrote:
These patches just enable extern "C" linking under Linux.
Were there no troubles with that? We had some C++ only enum declarations a while ago.

Good to see the D support being maintained, I have always been fond of D.


No problems anywhere, under Windows it's extern "C" __declpsec(dllexport). That's in regard to mangling equivalent to only extern "C" on Linux.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 06.10.2008, 19:09 
Offline

Joined: 06.10.2008, 19:05
Posts: 3
Hello,

how do I compile the knight sample with Horde3D 1.0 Beta 2? Sorry, but I don't get it :s

Cheers,

Fred


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 06.10.2008, 20:06 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
I have not yet updated the D bindings for the Beta 2 release. Have you done this yourself? There is a python script to create the new bindings.

There were some changes which broke the API in the beta 2 release. You would have to fix those, too. Just use the C++ version as a reference.

I'm quite busy with other issues, so I don't know when I'll have time to do the updates myself... But if you have more concrete questions I might be able to help you.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 22.10.2008, 10:44 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Maybe we can add the D bindings to the community branch as well. If the bindings are maintained and tested by someone we can also offer them on the SourceForge page. But to do this we should ensure that they work without problems.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 22.10.2008, 12:17 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
Hmm, probably it would be better if we look for another maintainer since I don't use D anymore: Primary reasons include that I just can't get half the code online to compile due to TWO incompatible "standard" libraries and some compiler problems. Until D 2.0 is stable and has ONE std lib I'll stop updating this binding.
If anyone wants to take over maintenance and has questions just ask me.

Here are updated bindings for the Beta 2, but I didn't try them:
http://odefu.googlecode.com/svn/trunk/DerelictHorde3D/



Maybe just use Python ;) As long as you don't do any large processing it should be just as fast as the D (or C/C++) version.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 25.10.2008, 22:26 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
Changed my mind... Bindings + D sample are now included in community svn and tested using the knight sample.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 26.10.2008, 09:12 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
:D Thanks a lot!


Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 04.06.2009, 06:43 
Offline

Joined: 04.06.2009, 06:38
Posts: 2
Here chicago sample :)


Attachments:
File comment: Chicago app sources
chicago.zip [3.73 KiB]
Downloaded 1392 times
Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 01.09.2009, 12:10 
Offline

Joined: 04.06.2009, 06:38
Posts: 2
Hello fellows,

Here updated bindings for Horde3D Beta 4.


Attachments:
Horde3D_beta4.zip [23.44 KiB]
Downloaded 1461 times
Top
 Profile  
Reply with quote  
 Post subject: Re: Bindings for D
PostPosted: 15.09.2010, 18:35 
Offline

Joined: 15.09.2010, 18:31
Posts: 53
1. I've updated bindings to Horde3D 1.0.0 Beta4 for D2.0 Phobos and Derelict 2.
To use it you need throw in `DerelictH3D` directory to Derelict2 source folder and compile with 'make -fwin32.mak'. Yes, I've done it only for Windows. Still might be helpful, not much work to update Makefile for Linux.
Attachment:
Derelict2.7z [5.69 KiB]
Downloaded 1361 times


2. I've updated someones port of `Chicago` H3D1.0.0Beta 4 example to D2 as well, so if You're interested. I'm not sure if it's proper version, had some mess so I won't give you a guarantee - You need to check it on Your own but still less work (if any) than updating.

Hint:
I can't remember what's about
Code:
Horde3DUtils.h3dutLoadResourcesFromDisk(cast(char*)("../Content"));
in crowd.d. I wont make it myself anymore since I'll probably try to interface crystalspace with D.
Attachment:
Chicago.7z [6.45 KiB]
Downloaded 1399 times


Everything was working properly so, cheers.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group