Graphics Library for D

Adam Wilson flyboynw at gmail.com
Tue Jan 7 10:59:52 PST 2014


On Tue, 07 Jan 2014 04:29:58 -0800, Ola Fosheim Grøstad  
<ola.fosheim.grostad+dlang at gmail.com> wrote:

> On Tuesday, 7 January 2014 at 12:11:49 UTC, qznc wrote:
>> On Monday, 6 January 2014 at 19:13:19 UTC, Ola Fosheim Grøstad Cairo  
>> supports defining paths and then drawing/filling them.
>
> Yes, but it is pragmatic in the sense that it apparently makes  
> approximations to arc (circle/ellipsis) and use more expensive cubic  
> primitives for quad beziers. Efficient fonts are often specified as the  
> cheaper quadratic beziers. Cubic beziers look better, but are more  
> expensive. Maybe the backends turn the cubics back into quads, I dunno.  
> I've just looked at the internal path representation.
>
> SVG covers a lot more ground, though. Including image fills,  
> filtereffects and animation.
>
>> I used Cairo (via GtkD) to produce pdf documents. The pdf and png  
>> backends are probably pretty unique for a graphics 2D library. Most  
>> just target a screen.
>
> I agree that Cairo is cool.
>
> I would personally rather see SVG in a standard library since that is  
> actually the most common vector graphics file format (Inkscape++) and  
> vector engine DOM: IE9+, Firefox, Chrome, Safari etc.
>
> I've just looked at the cinder api, and it looks like an internal  
> library pushed to the public (and yes, it apparently is):
>
> http://libcinder.org/docs/v0.8.5/hierarchy.html
>
> If one want a simple api for messing around with graphics then probably  
> Cairo or Processing would be a better choice, they are at least very  
> popular. Cinder is probably in the difficult intermediate position, not  
> easy enough for most dabblers, and not powerful enough for those who  
> have a strong interest in graphics.
>

Well, that's not what we saw at GoingNative. Mr. Sutter challenged the  
attendees to code up a game using Cinder in less than 24 hours. Over two  
dozen people who'd never seen Cinder before responded with games of  
varying complexity and completeness, but all ran and did game-like things.  
So I'd have to say that your theoretical appraisal of the API doesn't  
match the real outcomes we saw.

> If you want something that actually is standard, then the SVG DOM is the  
> only choice, IMHO.
>

SVG has a rep for being verbose and slow to parse (It is basically XML  
after all). Yes it's supported by all major browsers, I've just never seen  
anybody actually use it outside some small niches.

-- 
Adam Wilson
IRC: LightBender
Aurora Project Coordinator


More information about the Digitalmars-d mailing list