Rob Kramer wrote:
> On Tuesday 14 March 2006 06:51, James Gatt wrote:
>>> window.cpp: In constructor 'dtk::window::window(bool)':
>>> window.cpp:30: error: invalid conversion from 'int' to
>>> 'DFBWindowDescriptionFlags' window.cpp:31: error: invalid conversion from
>>> 'int' to 'DFBWindowCapabilities'
>>>
>>> Did I miss something?
>> I got around this by using:
>>
>> desc.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH | DWDESC_HEIGHT |
>> DWDESC_CAPS);
>>
>> etc. to cast the types. I consider this a workaround though - I think
>> the specific defines should really be written such that the assignment
>> can be done as in your original code. I suspect most people end up in
>> this situation with ++dfb.
> 
> That's just how enums work in c++; you can't convert int to an enum without 
> casting.. I believe there were some macros in ++dfb (or was it in dfb++) that 
> make life easier, but I haven't used the c++ bindings for ages.
> 
> Cheers,
> 
>      Rob

I think that constants which are bit-masks (and ORing them is planned) 
should not be a part of enums. Good old #define is infungible sometimes :)

                                     Radek Svoboda
                                     Neovision s.r.o., Prague
                                     [EMAIL PROTECTED]
                                     http://www.neovision.cz

_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to