Graphics Library for D

Matt Taylor taylorius at gmail.com
Tue Jan 14 02:44:55 PST 2014


On Tuesday, 14 January 2014 at 02:32:01 UTC, Adam Wilson wrote:
> On Mon, 13 Jan 2014 15:46:42 -0800, Matt Taylor 
> <taylorius at gmail.com> wrote:

>> 2. 2D/3D Graphics interface to underlying hardware. This can 
>> be useful - though it's not clear to me that the 2D part would 
>> be terribly useful on its own, without 3D OpenGL support, or 
>> possibly acting as primitives for a GUI library. I suppose 2D 
>> games could use it.
>>
>
> This is what Aurora is intended to be. The 2D part could be 
> used as the building blocks for a GUI or games or whatever else 
> you can come up with. Aurora is intended to be a 
> general-purpose graphics library for D. It should be usable on 
> any device/platform that D supports or will support.
>

Is Aurora exclusively 2D? Or will 3D get a look in?

>
>> If it were up to me (I know, it isn't) - I would create a 
>> graphics system for D based on a modern web-browser's 
>> Javascript DOM. I daresay not everything would map well to D, 
>> but I would start with that, and adapt it where necessary. I 
>> would include WebGL 2.0 support, mouse handling callbacks etc.
>>
>
> Do you mean HTML DOM? This would be similar to XAML and both 
> are UX languages which are unrelated to the purpose and goal of 
> Aurora. And don't think this would translate to well into D 
> code. One of the goals is to use idiomatic D as much as 
> possible.

Definitely not.  The web browser's DOM is a completely separate 
entity to HTML (even though HTML is commonly used to populate it 
on a webpage). A webpage can be constructed entirely 
programatically in javascript. Personally I wouldn't allow 
HTML,XAML or any other ML within a mile of my code. :-) No, I'm 
definitely talking about pure D. What we take from the DOM is 
it's structure and capabilities (i.e the Javascript DOM API), and 
then reinterpret that API into idiomatic D.



The thing with a 2D graphics API, is deciding what level you want 
it to work at. For example SDL is a 2D graphics API of sorts - it 
gives you a pixel array, and you can set each pixel to whatever 
colour you like.

Meanwhile, at the other end of the scale, you have a system with 
the capabilities of the Javascript DOM (see above), or the Flash 
player. This system can composite multiple 2D layers, and keep 
track of the contents of those layers.

Having said all that, I've a feeling that my thoughts are heading 
in a different direction to what you had planned :-) so forgive 
me if I'm merely distracting you from the task at hand.


Cheers

Matt


More information about the Digitalmars-d mailing list