FLTK2 bindings for D

unknown sphinski at netscape.net
Mon Aug 21 03:14:02 PDT 2006


Oh, I recognize that template_d.h is temporare file only?

For this error:
bcd/irrlicht/template_D.h:3: error: 'vector3d' is used as a type, but is 
not defined as a type.

Maybe this is the problem: vector code is in namespace irr::core, so 
should I use cmd option -Tirr::core::vector3d for it to recognize it as 
a defined type?

But if I use that then template_D.h will have line
irr::core::vector3d<DReflectedClass> __IGNORE_irr::core::vector3d;

which is of course illegal.


Also I see it generates full of C++ template code in D files, like from 
ISceneNode.d:

vector3d<float> getScale() {
void *cret = _BCD__ZNK3irr5scene10ISceneNode8getScaleEv(__C_data);
vector3d<float> dret = new vector3d<float>(cast(ireal) 0);
dret.__C_data = cret;
return dret;
}

But that's of courde without -Tvector3d option..

Could you work on this, is it known bug, or my mistake???

There is no examples that use templates.. do you have one?

Thanks



unknown kirjoitti:
> Hi!
> 
> I try to work on Irrlicht..
> 
> So I got all files generated, except one not important I could exclude 
> (propably much more files could be excluded)
> 
> But then for example vecror3d is template class so it needs to be worked 
> on.. so I add option -Tvector3d to the command, which is now:
> ./bcdgen $1/${i}.h irrlicht -I/home/me/D/bcd/irrlicht-1.1/include/ -r -E 
> -P -DV -Tvector3d -Tvector2d
> 
> Get output:
> vector2d
> In file included from <command line>:88:
> bcd/irrlicht/template_D.h:3: error: 'vector3d' is used as a type, but is 
> not defined as a type.
> bcd/irrlicht/template_D.h:4: error: 'vector2d' is used as a type, but is 
> not defined as a type.
> vector3d
> In file included from <command line>:88:
> bcd/irrlicht/template_D.h:3: error: 'vector3d' is used as a type, but is 
> not defined as a type.
> bcd/irrlicht/template_D.h:4: error: 'vector2d' is used as a type, but is 
> not defined as a type.
> 
> 
> template_d.h:
> #include "../bind.h"
> #include "/home/me/D/bcd/irrlicht-1.1/include/vector3d.h"
> vector3d<DReflectedClass> __IGNORE_vector3d;
> vector2d<DReflectedClass> __IGNORE_vector2d;
> 
> Also template_D.h seems to be regenerated for every header, so it 
> includes only vector3d.h.. I am not very experienced..
> 
> maybe better idea to remove templates by duplicating the template class 
> to two separate classes vector3df and vector3di? They are typedefed 
> anyway there..
> typedef vector3d<f32> vector3df;
> typedef vector3d<s32> vector3di;
> 
> Thanks.
> 
> Gregor Richards kirjoitti:
>> I made an attempt at OGRE, which was unfortunately not very 
>> successful, because OGRE makes heavy use of the STL :(
>>
>>  - Gregor Richards
>>
>>
>> unknown wrote:
>>> Hi!
>>>
>>> I do not think it is competing too much. Native gui is necessary and 
>>> important for D to collect momentum. Momentum brings more native work.
>>>
>>> But seems many ports to native D are started and then cancelled (no 
>>> time, no interest, no people), so I see bcd very necessary.
>>>
>>> I did not know bcd. I am interested if binding to 3d engine like 
>>> Irrlich, Ogre or similar could be generated. I might give it a try.
>>>
>>>
>>>
>>> Gregor Richards kirjoitti:
>>>
>>>> I hate to compete with the far more compelling FLTK-port-to-D 
>>>> thread, but I don't think many people know about this, and it's 
>>>> definitely useful.  There are FLTK2 bindings in D, autogenerated by 
>>>> bcd.gen ( http://www.dsource.org/projects/bcd/ ).  Since they're 
>>>> generated automatically, they have very nearly the exact same API as 
>>>> the native C++ ones, PLUS they're easy to keep up to date (if they 
>>>> become incompatible, I can just run the script again and bring them 
>>>> up to date).
>>>>
>>>> They're available in SVN, info on checking them out is on the BCD 
>>>> web page ( http://www.dsource.org/projects/bcd/ ).
>>>>
>>>> Finally: These bindings have been partially but not completely 
>>>> tested. If you find a problem, it can probably be solved quite 
>>>> easily, in most cases it's a discrepancy between the FLTK2 .h files 
>>>> and .cxx files (naughty naughty).  Just tell me by some means (NG, 
>>>> email, whatever).
>>>>
>>>>  - Gregor Richards



More information about the Digitalmars-d-dwt mailing list