Graphics Library for D

Adam Wilson flyboynw at gmail.com
Tue Jan 7 12:05:50 PST 2014


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

> On Tuesday, 7 January 2014 at 19:00:46 UTC, Adam Wilson wrote:
>> You seem very concerned that the low-level API will effect the design  
>> of the high-level API. If that happens we've failed and need to try  
>> again.
>
> No, I am afraid that you pick a high-level ENGINE (not HAL API) and  
> dress it up. If you actually use a low level api, it will be shader  
> based and use roughly the same pipeline. DX3D and GL have feature parity  
> if you stay away from the esoteric stuff.
>
>> I asked Mike Parker about this at Dconf 2013, with the intent of having  
>> a reference implementation. You know what he said? Don't bother.  
>> Because in the end it does not matter which implementation you start  
>> with, other API's will look different no matter what you do, even for  
>> OGL (differing implementations), differing fonts, differing rendering  
>> pipelines, etc...
>
> No. Simple shaders work roughly the same on modern hardware, though you  
> need performance tweaks, avoid accumulated FP errors etc. If you don't  
> depend on system fonts, fonts should not differ.
>

That depends on how one defines system fonts I suppose. I was figuring  
Open/TrueType fonts at least, which are all vector fonts.

>> His advice was to pick whatever worked best for the implementor and  
>> make the other API implementations look as close a possible and have  
>> people submit bug reports.
>
> I am arguing in favour of having one reference implementation that is  
> highly portable. There is no need to match up pixels to anything if  
> there is only one solution…

Right, but Mike Parker has experience doing this, his opinion counts for  
quite a bit. His biggest point however is that the high-level API should  
be completely independent of the low-level API's. The high-level API  
describes what the user wants and it's up to the graphics API implementor  
to get it right. To be honest I would rather use a 2D graphics library  
like cairo that supports OpenGL on Posix systems before we went to the  
trouble of making OpenGL render 2D shapes in 3D space, I've done that  
before, it's not easy. One of the more difficult problems is converting 2D  
pixels into the Cartesian coordinates system while accounting for DPI.  
It's doable, but it's more a LOT work than working with Direct2D or Cairo  
or some other suitable API...

-- 
Adam Wilson
IRC: LightBender
Aurora Project Coordinator


More information about the Digitalmars-d mailing list