June 02, 2021

On Tuesday, 1 June 2021 at 20:20:34 UTC, Ola Fosheim Grøstad wrote:

>

Web components are becoming a reality, it essentially means that you have code and styling wrapped up as a component, so that you can use it by inserting a custom html-tag in your code. Given the massive amount of web developers... you'll eventually have a crazy amount of components to choose from. Just waiting for Safari:

https://caniuse.com/?search=components

I think?

It's 2021 and I'm still waiting for parent selectors. Even :has() isn't implemented by anything yet.

June 02, 2021
>

On Tuesday, 1 June 2021 at 23:42:58 UTC, someone wrote:

>

Bump.

On Tuesday, 1 June 2021 at 23:50:35 UTC, Ola Fosheim Grøstad wrote:

>

Not sure what you meant?

errr ... me neither !

Now seriously: attempted to tell you that evidently I know far less than what I think I know.

>

Of course not, D is a hobby and I consider D to be a work-in-progress.

Crystal-clear.

>

Not sure how that relates to Skia? Skia is used in many products. If I was to use D for something serious, Skia would probably be the first thing I would consider...

ACK.

June 02, 2021

Btw there is also (dear) imgui, which is immediate mode GUI that builds geometry to draw for you, how one would draw it is up to programmer. It is very popular in game dev because there is very little setup to get it working.

Source
https://github.com/ocornut/imgui

D bindings with GL3 demo
https://github.com/Superbelko/imgui-d

On Tuesday, 1 June 2021 at 23:50:35 UTC, Ola Fosheim Grøstad wrote:

>

Not sure how that relates to Skia? Skia is used in many products. If I was to use D for something serious, Skia would probably be the first thing I would consider...

Yep, use Skia/Cairo or something like this, don't build your own full blown 2D engine for every possible graphics API.

I would like to tune my C++ bindings generator to be able to handle Skia ASAP, but can't tell when it will be possible.

June 02, 2021

On Wednesday, 2 June 2021 at 01:29:51 UTC, cc wrote:

>

It's 2021 and I'm still waiting for parent selectors. Even :has() isn't implemented by anything yet.

I think that is because :has() is Selectors Level 4, which is a working draft, so not a standard yet.

https://www.w3.org/Style/CSS/current-work

June 02, 2021
02.06.2021 00:47, Ola Fosheim Grøstad пишет:
> Note: Many simple GUI toolkits are horribly inefficient as they let each object render themselves.  An efficient GUI engine will have to replicate some of the browser complexity...

I tried retained and immediate GUI, both fail (imho) for my use case - large data set of 1M+ heterogeneous items. GTK and Qt are very complicated in case of TreeView widgets in contrast to dear imgui or nuklear. In retained GUI (GTK and Qt) you need to prepare your data, create some intermediate data, probably copy data. TreeView in immediate GUI (imgui, nuklear) is pretty trivial and intuitive - you just use your data w/o anything else but it draws all items always so immediate GUI works nice if you have small data set. nuklear lets you use large data set but only if items have the same height. But because an item of TreeView can be collapsed or not its height changes and you need to calculate height for each items - you can do it yourself but available implementations of immediate GUI aren't capable to use that info so you need to modify immediate GUI core system and that is very complicated job in contrast to retained GUI where adding new widget is much easier.

I was forced to invent my own wheel some where in-between retained and immediate GUI. Later I got know that it worked like browsers did (of course in general). I think that browser-like GUI is the future. Just current browsers are very over-engineered.

My impression is that immediate and retained GUI belong to different domains and are not interchangeable. Browser-like GUI is superset of both retained and immediate GUI. Just it should be implemented properly.
June 02, 2021
On Wednesday, 2 June 2021 at 09:37:10 UTC, drug wrote:
> 02.06.2021 00:47, Ola Fosheim Grøstad пишет:
> I tried retained and immediate GUI, both fail (imho) for my use case - large data set of 1M+ heterogeneous items.

Depends on the data, I guess, if they are all visible at once then you basically have to very carefully write your own GPU render stage for that view and carefully cache things that does not move by rendering them to buffers (in GPU memory).

> I was forced to invent my own wheel some where in-between retained and immediate GUI. Later I got know that it worked like browsers did (of course in general). I think that browser-like GUI is the future. Just current browsers are very over-engineered.

They have some inefficiencies in how the DOM is being manipulated (like setting numeric styles as strings, but there is a fix coming for this, maybe it is available already?)

But if you deal with large number of items you basically can write your own view and dynamically create elements as the user scrolls. You do need to estimate the height though.

You can have a web-worker handling the dataset and basically stream it to the main thread that does the GUI. There is a delay though, so it takes some tweaking.

June 02, 2021
02.06.2021 12:50, Ola Fosheim Grøstad пишет:
> Depends on the data, I guess, if they are all visible at once then you basically have to very carefully write your own GPU render stage for that view and carefully cache things that does not move by rendering them to buffers (in GPU memory).

Usually 1 million of items aren't visible at once. Also there is opinion that total redrawing can be more efficient than caching because of making a decision what to cache and what not can be very complex.

> But if you deal with large number of items you basically can write your own view and dynamically create elements as the user scrolls. You do need to estimate the height though.

To estimate the height you need to have height of every elements, you can't dynamically create elements in that case. I create some wrapper over data set that stores height of elements. It's much cheaper and faster than creating a widget per item - that is a real advantage over retained gui. And user has access to that info - that is advantage over immediate gui. But yes, there are tasks that can/should be performed by dynamically created elements.

June 02, 2021
On Wednesday, 2 June 2021 at 10:17:52 UTC, drug wrote:
> Usually 1 million of items aren't visible at once. Also there is opinion that total redrawing can be more efficient than caching because of making a decision what to cache and what not can be very complex.

Depends on the application.

My view on the GPU has changed a bit as some applications may use the GPU for computing application data, also pushing the GPU too hard will make it hot and fans  start running (making users wonder what the app is doing).

Say, if I used an accounting program and it caused the fan to spin, then I would be annoyed. :-D

> To estimate the height you need to have height of every elements, you can't dynamically create elements in that case. I create some wrapper over data set that stores height of elements. It's much cheaper and faster than creating a widget per item - that is a real advantage over retained gui. And user has access to that info - that is advantage over immediate gui. But yes, there are tasks that can/should be performed by dynamically created elements.

Varying heights can be tricky, so just computing the heights in a wrapper seems reasonable.

Another approach is to use an estimate that is updated as you bring in more items, but that is real work (for the programmer).

June 02, 2021

On Wednesday, 2 June 2021 at 05:43:49 UTC, evilrat wrote:

>

Yep, use Skia/Cairo or something like this, don't build your own full blown 2D engine for every possible graphics API.

I would like to tune my C++ bindings generator to be able to handle Skia ASAP, but can't tell when it will be possible.

It happens that Skia now has C API.
I've generated C bindings and made my own BindBC package from it.

https://github.com/Superbelko/bindbc-skia

June 03, 2021

On Tuesday, 1 June 2021 at 20:56:05 UTC, someone wrote:

>

On Tuesday, 1 June 2021 at 16:20:19 UTC, Ola Fosheim Grøstad wrote:

>

[...]

I wasn't considering/referring to content in the browser, this is an entirely different arena.

[...]

Thank you! I can only agree.

1 2 3 4 5 6 7 8 9
Next ›   Last »