Jump to page: 1 2 3
Thread overview
Release: nanovega.d rendering lib like html5 canvas
Mar 08, 2018
Adam D. Ruppe
Mar 08, 2018
WebFreak001
Mar 08, 2018
aberba
Mar 09, 2018
WebFreak001
Mar 08, 2018
aberba
Mar 08, 2018
Adam D. Ruppe
Mar 09, 2018
Adam D. Ruppe
Apr 02, 2018
drug
Apr 02, 2018
Adam D. Ruppe
Apr 03, 2018
Andrew Edwards
Apr 04, 2018
drug
Apr 07, 2018
drug
Apr 11, 2018
bauss
Apr 11, 2018
drug
Apr 11, 2018
Adam D. Ruppe
Apr 11, 2018
drug
Apr 11, 2018
drug
Apr 11, 2018
Adam D. Ruppe
Apr 11, 2018
drug
Apr 30, 2018
Chris
Apr 30, 2018
drug
Apr 28, 2018
drug
Apr 28, 2018
Adam D. Ruppe
Apr 28, 2018
drug
Apr 30, 2018
Chris
March 08, 2018
https://github.com/adamdruppe/arsd

nanovega.d

depends on: simpledisplay.d, color.d, and ttf.d (latter only on Windows)

Should also be present in v1.3 of the dub package http://code.dlang.org/packages/arsd-official

API docs (includes an example to get you started)
http://dpldocs.info/experimental-docs/arsd.nanovega.html

This module's primary author is ketmar. What follows is his description:


NanoVega is a fork of the famous NanoVG rendering library. it was ported to D, and then updgraded with various features.

NanoVega is using OpenGL for rendering (i.e. no intermediate rasterize-to-picture step), and its API modelled after HTML5 canvas API.

most interesting *new* features are:

 * clipping to paths

 * support for non-zero and even-odd fill rules. original NanoVG only
supported non-zero (despite what it's README says).

 * fontconfig support on Posix systems.

 * full-featured picking API: you can check if your mouse cursor is inside of a filled path, or on the border of a stroked path. you don't need to render your pathes for this, and you can do your tests *before* rendering (to change colors of UI elements on mouse hover, for example). it is quite fast,  and is using quad-tree to further speed up the tests.

 * NanoVega is completely @nogc!

 * easy to use and powerful text API: accepts `char`, `wchar`, and `dchar` strings, so you don't need to convert your text back and forth! provides iterators and callback-based API to get various text metrics.

 * doesn't require any dependencies besides ARSD modules.

 * extensive DDoc documentation and sample code.

 * comes with Blendish port to make your UI rendering easy and fun. <http://dpldocs.info/experimental-docs/arsd.blendish.html> (see blendish.d in the arsd repo)

there is also standalone SVG parser and rasterizer, based on NanoSVG project. it was forked, ported to D, and made even better than the original! <http://dpldocs.info/experimental-docs/arsd.svg.html>

 * completely standalone, doesn't require any other modules.

 * converts your SVGs to drawing commands or cubic bezier curves.

 * supports standalone "style" tag.

 * has better and faster XML parser.

 * has builtin rasterizer, so you can convert your icons to images for speed.

 * can be used with NanoVega to render SVGs without prior rasterizing.

 * FAST! and @nogc!


enjoy, and happy hacking. ;-)
March 08, 2018
On Thursday, 8 March 2018 at 03:55:35 UTC, Adam D. Ruppe wrote:
> https://github.com/adamdruppe/arsd
>
> nanovega.d
>
> [...]

AMAZING! I think this will revolutionize how we do GUI and rendering in D, especially nogc. You can make really cool effects and renders very quickly.

Got some cool project ideas how you could use this already. You could make a WPF clone in D for example if you put in a lot of time, but it would probably be far superior than all other currently existing GUI toolkits if you get the data binding and event layer right.
March 08, 2018
On Thursday, 8 March 2018 at 19:24:43 UTC, WebFreak001 wrote:
> On Thursday, 8 March 2018 at 03:55:35 UTC, Adam D. Ruppe wrote:
>> https://github.com/adamdruppe/arsd
>>
>> nanovega.d
>>
>> [...]
>
> AMAZING! I think this will revolutionize how we do GUI and rendering in D, especially nogc. You can make really cool effects and renders very quickly.
>
> Got some cool project ideas how you could use this already. You could make a WPF clone in D for example if you put in a lot of time, but it would probably be far superior than all other currently existing GUI toolkits if you get the data binding and event layer right.

And theming. Especially with a subset of CSS.
March 08, 2018
On Thursday, 8 March 2018 at 03:55:35 UTC, Adam D. Ruppe wrote:
> https://github.com/adamdruppe/arsd
>
> nanovega.d
>
> [...]

Why is there NVG* everything? That's code noise.

Anyways, its well documented.
March 08, 2018
On Thursday, 8 March 2018 at 22:16:50 UTC, aberba wrote:
> Why is there NVG* everything? That's code noise.

It is a fork and port from a C codebase.

Fairly little of that is used in the public api though.
March 09, 2018
Now also on dub:

http://code.dlang.org/packages/arsd-official%3Ananovega
March 09, 2018
On Thursday, 8 March 2018 at 22:08:30 UTC, aberba wrote:
> On Thursday, 8 March 2018 at 19:24:43 UTC, WebFreak001 wrote:
>> On Thursday, 8 March 2018 at 03:55:35 UTC, Adam D. Ruppe wrote:
>>> https://github.com/adamdruppe/arsd
>>>
>>> nanovega.d
>>>
>>> [...]
>>
>> AMAZING! I think this will revolutionize how we do GUI and rendering in D, especially nogc. You can make really cool effects and renders very quickly.
>>
>> Got some cool project ideas how you could use this already. You could make a WPF clone in D for example if you put in a lot of time, but it would probably be far superior than all other currently existing GUI toolkits if you get the data binding and event layer right.
>
> And theming. Especially with a subset of CSS.

Yeah you can make really cool effects: https://wfr.moe/fFYvHH.png

---

string txt = "Text me up.";
float[4] bounds;
nvg.fontFace = "Roboto";
nvg.fontSize = 32;
nvg.textBounds(64, 64, txt, bounds[]);
nvg.beginPath();
nvg.roundedRect(bounds[0] - 32, bounds[1] - 8 + 8, bounds[2]-bounds[0] + 64, bounds[3]-bounds[1] + 16, 4);
nvg.fillPaint = nvg.linearGradient(bounds[0], bounds[1], bounds[2], bounds[3], NVGColor("#c50"), NVGColor("#860"));
nvg.fill();
nvg.beginPath();
nvg.roundedRect(bounds[0] - 32, bounds[1] - 8, bounds[2]-bounds[0] + 64, bounds[3]-bounds[1] + 16, 4);
nvg.fillPaint = nvg.linearGradient(bounds[0], bounds[1], bounds[2], bounds[3], NVGColor("#f70"), NVGColor("#a90"));
nvg.fill();
nvg.fillPaint = pattern;
nvg.fill();
nvg.beginPath();
nvg.roundedRect(bounds[0] - 32, bounds[1] - 8, bounds[2]-bounds[0] + 64, bounds[3]-bounds[1] + 16 + 8, 4);
nvg.strokeColor = NVGColor.white;
nvg.strokeWidth = 2;
nvg.stroke();
nvg.fillColor = NVGColor.black;
nvg.text(64, 64, txt);
April 02, 2018
09.03.2018 18:38, Adam D. Ruppe пишет:
> Now also on dub:
> 
> http://code.dlang.org/packages/arsd-official%3Ananovega

Hasn't somebody started porting nanogui (https://github.com/wjakob/nanogui)? I'd like to do it, but don't want to duplicate efforts.
April 02, 2018
On Monday, 2 April 2018 at 07:55:26 UTC, drug wrote:
> Hasn't somebody started porting nanogui (https://github.com/wjakob/nanogui)? I'd like to do it, but don't want to duplicate efforts.

I don't know.
April 03, 2018
On Monday, 2 April 2018 at 07:55:26 UTC, drug wrote:
> 09.03.2018 18:38, Adam D. Ruppe пишет:
>> Now also on dub:
>> 
>> http://code.dlang.org/packages/arsd-official%3Ananovega
>
> Hasn't somebody started porting nanogui (https://github.com/wjakob/nanogui)? I'd like to do it, but don't want to duplicate efforts.

I made an attempt last year but not much came of it. Would like to help out if you don’t mind slowing your pace a bit to provide some mentoring when the need arises.

Andrew
« First   ‹ Prev
1 2 3