www.digitalmars.com         C & C++   DMDScript  

D - Interfacing D with C + MS Visual Studio

reply "QUS" <qus go2.pl> writes:
I've been working on a game lately (frontier/elite type) and hope I can port
the most important class code into D from C++ (btw - that would give D some
good matrix/vector/quaternion and Micro;-)ODE classes), but of course
there's some DirectInput, DirectSound and OpenGL also. AFAIK D can't
interface with C++, but can with C. I have no idea about C, but maybe I can
convert Direct/OGL parts to it and link it into D. The question is: do I
have to make any BIG changes to Visual Studio .NET to do this trick? I guess
it should be stupid enough to think D source is C++, and give me all those
nice class completion features. But what about the linker?

Cheers,
QUS
Aug 07 2003
next sibling parent "Walter" <walter digitalmars.com> writes:
"QUS" <qus go2.pl> wrote in message news:bgt0a0$2m9r$1 digitaldaemon.com...
 I've been working on a game lately (frontier/elite type) and hope I can
port
 the most important class code into D from C++ (btw - that would give D
some
 good matrix/vector/quaternion and Micro;-)ODE classes), but of course
 there's some DirectInput, DirectSound and OpenGL also. AFAIK D can't
 interface with C++, but can with C. I have no idea about C, but maybe I
can
 convert Direct/OGL parts to it and link it into D. The question is: do I
 have to make any BIG changes to Visual Studio .NET to do this trick? I
guess
 it should be stupid enough to think D source is C++, and give me all those
 nice class completion features. But what about the linker?
The D linker, Optlink, uses Microsoft OMF format. The VC linker uses Microsoft COFF format. You can convert the latter to the former using COFF2OMF.
Aug 07 2003
prev sibling next sibling parent reply Farmer <itsFarmer. freenet.de> writes:
"QUS" <qus go2.pl> wrote in news:bgt0a0$2m9r$1 digitaldaemon.com:

 convert Direct/OGL parts to it and link it into D. The question is: do I
 have to make any BIG changes to Visual Studio .NET to do this trick? I
 guess it should be stupid enough to think D source is C++, and give me
 all those nice class completion features. But what about the linker?
I don't know about Visual Studio .NET, but I got my trusty Visual Studio 6.0 to treat D files as C++ files. VS 6.0 is quite rigid about proper C++ syntax (it even refuses some correct C++ code), so it doesn't work well with most D code. With quite some tweaking of VS 6.0 and a C++-compatible D-coding style, I get reasonable code completion results and a modest class view. But since .NET is about using multiple languages, I expect VS .NET to be better suitable for use with new unsupported languages than VS 6.0.
Aug 07 2003
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
Well, they did start releasing the $30000 development kit for free,
recently.  ;)

Sean


===================

I've just saw on the xds newsgroups that VSIP SDK was
released today for free (it used to cost a lot - about $30k)

http://www.vsipdev.com

VSIP SDK allows you to customize your Visual Studio .NET environment and
integrate deeply into Visual Studio .NET. Increase
productivity, deliver solutions faster, and improve overall product quality.
VSIP also contains the new Help system VSHIK, which the
MSDN uses.

VSIP requires VS .NET 2003 (at least VSHIK setup
program reported so).


===================

"Farmer" <itsFarmer. freenet.de> wrote in message
news:Xns93D0F417B7B0FitsFarmer 63.105.9.61...
 But since .NET is about using multiple languages, I expect VS .NET to be
 better suitable for use with new unsupported languages than VS 6.0.
Aug 08 2003
parent reply "QUS" <qus go2.pl> writes:
 VSIP requires VS .NET 2003 (at least VSHIK setup
 program reported so).
Aw! 3,32 GB to download... ;-)
Aug 08 2003
parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
Try that at 300 baud sometime!! ;)


"QUS" <qus go2.pl> wrote in message news:bgvvv5$2dqo$1 digitaldaemon.com...
 Aw! 3,32 GB to download... ;-)
Aug 08 2003
prev sibling parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
You can easily interface to COM in D.  If you can port the DirectX headers
to D (it's mostly trivial-- I've done it for Direct3D 8 already) you can
talk to DirectX directly from D.

If all the people on this NG pooled their DirectX headers together we'd
probably have a mostly complete conversion.

I believe someone has already ported OpenGL interface to D.  It's straight
C, so it's easier.

You won't be able to use Visual Studio for much more than an editor or
project manager, I'm afraid.  You have to use a makefile project or give
each D file custom build steps.  Oh, and the debugger works fairly well for
D code, but it won't unmangle D symbol names.

Sean

"QUS" <qus go2.pl> wrote in message news:bgt0a0$2m9r$1 digitaldaemon.com...
 I've been working on a game lately (frontier/elite type) and hope I can
port
 the most important class code into D from C++ (btw - that would give D
some
 good matrix/vector/quaternion and Micro;-)ODE classes), but of course
 there's some DirectInput, DirectSound and OpenGL also. AFAIK D can't
 interface with C++, but can with C. I have no idea about C, but maybe I
can
 convert Direct/OGL parts to it and link it into D. The question is: do I
 have to make any BIG changes to Visual Studio .NET to do this trick? I
guess
 it should be stupid enough to think D source is C++, and give me all those
 nice class completion features. But what about the linker?

 Cheers,
 QUS
Aug 08 2003
parent reply "QUS" <qus go2.pl> writes:
 You can easily interface to COM in D.  If you can port the DirectX headers
 to D (it's mostly trivial-- I've done it for Direct3D 8 already) you can
 talk to DirectX directly from D.
Ha! So where's the link?! :-)
 If all the people on this NG pooled their DirectX headers together we'd
 probably have a mostly complete conversion.
People! Send your links! :-)
 I believe someone has already ported OpenGL interface to D.  It's straight
 C, so it's easier.

 You won't be able to use Visual Studio for much more than an editor or
 project manager, I'm afraid.  You have to use a makefile project or give
 each D file custom build steps.  Oh, and the debugger works fairly well
for
 D code, but it won't unmangle D symbol names.
Actually, I found microsoft VS addon development pack, that was used for creating Visual Studio plugins for Eiffel, Python and Perl. You can see the screenshots and info on MS pages: http://www.vsippartners.com/search.aspx?SearchText=&CompName=&ProdName=&PT=, 12, If I have some time, and if it is not very difficult I may even try to write a plugin for D (in D, of course... :-)
Aug 08 2003
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
"QUS" <qus go2.pl> wrote in message news:bgvrpf$2a6u$1 digitaldaemon.com...
 You can easily interface to COM in D.  If you can port the DirectX
headers
 to D (it's mostly trivial-- I've done it for Direct3D 8 already) you can
 talk to DirectX directly from D.
Ha! So where's the link?! :-)
What, you mean I have to bother setting up my webpage again? ;) I figured I'd email you a .zip.
 Actually, I found microsoft VS addon development pack, that was used for
 creating Visual Studio plugins for Eiffel, Python and Perl. You can see
the
 screenshots and info on MS pages:
http://www.vsippartners.com/search.aspx?SearchText=&CompName=&ProdName=&PT=,
 12,

 If I have some time, and if it is not very difficult I may even try to
write
 a plugin for D (in D, of course... :-)
Wow, we almost tied posting that info. ;) 16 minutes apart Sean
Aug 08 2003
parent "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:bgvsq1$2b66$1 digitaldaemon.com...
 "QUS" <qus go2.pl> wrote in message
news:bgvrpf$2a6u$1 digitaldaemon.com...
 You can easily interface to COM in D.  If you can port the DirectX
headers
 to D (it's mostly trivial-- I've done it for Direct3D 8 already) you
can
 talk to DirectX directly from D.
Ha! So where's the link?! :-)
What, you mean I have to bother setting up my webpage again? ;) I
figured
 I'd email you a .zip.
Yes, please put it on a web page!
Aug 09 2003