www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Q: Using Cg with D

reply "ginophi" <ginophi fjw3n90v.com> writes:
I just found out about D and it seems like a very interesting language. At
my internship they are interested about using Cg. Since I want to learn as
much as possible I would like to use D. As I don't know how to interface the
two I'd like to know if anyone here has any experience in this and is
willing to help or point me in the right direction. Thanks.
Jun 25 2007
parent Bill Baxter <dnewsgroup billbaxter.com> writes:
ginophi wrote:
 I just found out about D and it seems like a very interesting language. At
 my internship they are interested about using Cg. Since I want to learn as
 much as possible I would like to use D. As I don't know how to interface the
 two I'd like to know if anyone here has any experience in this and is
 willing to help or point me in the right direction. Thanks.
 
 

I don't know if anyone has done it, but it should be possible since the Cg api is C and Cg ships as a dll. You should be able to use implib to create a D-compatible .lib from the cg.dll / cgGL.dll. Then I bet htod or bcd would be able to convert the headers automatically since they're quite simple and use very little macro magic. Of course if someone has already done all that, that would be easier. :-) --bb
Jun 25 2007