On 23.05.2011, at 16:41, asif saeed wrote:

> In my opinion, any code injection and any run-time costs/features should be
> optional. I would suggest that you use templates (policy traits) to enable
> users to mix-n-match the things that they want. At least, I do not want any
> run-time code injection. If I want that feature, i can do that on top of
> fltk. Including this in FLTK would mean making it top-heavy. I have some
> performance requirements that I need to meet. Adding top-heavy features
> would factor out FLTK - if runtime features are to be added then they can be
> provided as separate library components. I don't think they should be
> bundled with the core FLTK lib.

The cost is absolutely minimal. If you don't use the emulation layer, it will 
be in the order of single CPU cycles. All virtual functions need one additional 
"if" instruction, checking a pointer for NULL. Compared to the run time of the 
draw() function, this is not measurable.

The gain is tremendous though: even if you never use it yourself, it will allow 
you to use existing widgets that others wrote, no matter if they were written 
for FLTK 1 or FLTK 2. You will be able to move your application from whatever 
you use right now to FLTK 3 without rewriting a single (hopefully ;-) line of 
code. 

If that's not worth one single "if" statement, I don't know what is :-P

BTW, asif, I write embedded code and I run FLTK one very small devices. I would 
not add anything that generates a top-heavy library. That's what we have Qt for.

 - Matthias
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to