What library functionality would you most like to see in D?
Marco Leise
Marco.Leise at gmx.de
Mon Aug 1 23:02:41 PDT 2011
Am 02.08.2011, 04:48 Uhr, schrieb Adam D. Ruppe
<destructionator at gmail.com>:
> I've been thinking about a minimalist drawing library for
> phobos - just basic 2d stuff, but with easy enough hooks to
> add more (native api events and handles.
>
> Nobody is likely to agree on a widget set, but basic drawing
> functions give a little usability with pretty small cost.
>
> I had a decent start a month or two ago but have since stalled out
> as my schedule became more ridiculous.
I used a few drawing APIs: Delphi/Win32, Java2D, HTML5 Canvas, Gtk+ and
recently Cairo. If there was a drawing API in Phobos I wish it was like
Cairo. While some basic APIs have some special ability (like shadows in
the HTML canvas) they often lack some essential functions. Java2D offers a
lot, but I consider it bloated, YMMW. When I was writing a tool I came to
need more and more advanced features:
- fonts and text drawing
- clipping
- scaling (part of matrix manipulation)
- transparency
- measuring of the extents of what is about to be drawn
I was using GtkD, the D wrapper for Gtk and Gtk lacked a lot of this.
Fortunately Gtk comes with Cairo bindings which offered all that. This is
just one example and just me, but I really think Cairo's API is very well
designed, similar to Java2D and HTML5 Canvas and would be my reference for
a drawing API in D. It doesn't need to offer bezier curves and
anti-aliasing in the first version, but the idea of filling and stroking
shapes or drawing surfaces that can be rendered into each other are kind
of a standard now that can be built upon :)
- Marco
More information about the Digitalmars-d
mailing list