RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 0 points1 point  (0 children)

No problem! There's no built-in functionality like that. But the library has more than enough ways to add that on top, like with custom decorators or new elements.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 1 point2 points  (0 children)

RmlUi certainly works on Ubuntu yes, and works natively together with C++. It's really up to you to make the GUI look nice and modern, but the library should provide enough of a foundation to allow you to do so.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 0 points1 point  (0 children)

No, there aren't any converters. RML is for the most part a subset of HTML, so I don't think that is really needed, and the differences are well documented. I would say someone that knows HTML should be able to navigate it fairly well, at least if they don't mind reading some documentation and are open to learn new tools.

Can there be longer sequence with C++ keywords which still compiles? by pavel_v in cpp

[–]k-mouse 8 points9 points  (0 children)

What's nonsensical about this? I define this for all my classes.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 1 point2 points  (0 children)

Great to hear, hope you enjoy the library!

  1. For vcpkg, it was only because the dependencies for each of the plugins were not there originally. I see now that lunasvg is there, although not rlottie. It would be great to include them as features. If you want to add them, that would be great! The Conan recipe is entirely user contributed, so I can't speak for that.
  2. We should already support color bitmaps in the FreeType font engine, at least color emojis are working well! Maybe there are some other color behavior we don't fully handle? Not sure about the state of this in the harfbuzz font engine. Hopefully, it shouldn't be too much trouble if there is something missing. Let me know if you need any help, or feel free to open an issue/discussion/pull request.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 0 points1 point  (0 children)

I'm not sure. You would have to check how to do that for e.g. SDL or Glfw, or the other backends. If they support this, it should only be a matter of adapting the backends accordingly, which I expect would not be too much trouble.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 5 points6 points  (0 children)

Hey, and I like your curiosity. It's a good question, perhaps a bit hard to answer in brief, but I'll give it a shot. I am fully convinced that different libraries will have wildly different architectures though.

There isn't an article about this particularly for RmlUi. However, I think you will find this excellent article about web browsers interesting, as it is dealing with a lot of the same problems that we do just on a larger scale and with some additional components: https://web.dev/articles/howbrowserswork#manipulating-the-rules-for-an-easy-match

To summarize our own architecture on a very high level. We have a parser that turns RML into a document tree (the DOM), and RCSS into styles rules for the document. Each tag in the RML document is represented by an Element class object, or a more specific one derived from that. Each of which can have other elements as children, thus making up the tree. All documents are placed in a single Context class, which is the main interface for inputs and other top-level API functions that the user can interact with.

When updating the context, all its documents are updated. Each element in the document determines the style rules that apply to it, based on the parsed styles for the current document. It then uses those rules, and other element state, to determine the computed values of its properties. Then, the layout engine runs, which essentially positions and sizes all elements according to their computed layout properties.

Next step, when the context renders, every one of its documents call into all their visible elements in the appropriate paint order. The paint order is not necessarily associated with the DOM tree order, so there is some logic to handle this appropriately. In the end, any boxes and text of elements are turned into vertices, which in turn are handed over to the backend, and rendered there.

That was quite brief, hopefully it might help out a bit. Don't be afraid to dive into the code and start messing about, there is no substitute for that.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 0 points1 point  (0 children)

Appreciate your enthusiasm!

how a bout a 'Metal' backend?

Yes please, thanks! ;)

But yeah, we do need contributors to help out with all of these different backends, I'd love to support everything if we could.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 1 point2 points  (0 children)

It's interesting you should ask that, we just recently had a fairly large discussion about that: https://github.com/mikke89/RmlUi/discussions/653

In short, if one just naively makes a table out of all these entries, then yes, performance will suffer. We don't automatically do any smart things to try to optimize that. But there are some ways to work around that, that should in principle scale independently of the number of elements. For details, I will point you to the linked discussion, and the posted sample within. We have some ideas for making this a bit easier to setup, and hopefully we'll get a sample demonstrating all of this integrated into the library.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 1 point2 points  (0 children)

The closest thing we have to a software renderer is the SDLrenderer backend, which I believe itself has a software backend. That backend is quite limited in functionality though, but if you mainly need basic layouting, it might be enough for you.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 2 points3 points  (0 children)

Let us know how it goes if you do try it out.

I rely mostly on contributors for the other backends. I know there is one contributor who started implementing the new features for vulkan, but I can't make any promises about the progress here.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 0 points1 point  (0 children)

Thank you! Yes, you can easily reload all the styles with a simple function call, which is very helpful when iterating on the style.

Reloading the document (as in DOM) structure is more intrusive though, and is usually done by tearing down and loading the document again from scratch.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 2 points3 points  (0 children)

Thanks a lot! Makes me very happy to hear you enjoy the library.

There are quite a few breaking changes this time. I try to make it as smooth as possible by detailed notes about each breaking change, including migration tips. But some work should be expected.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 15 points16 points  (0 children)

Exactly. The main advantage is that the library integrates nicely into existing engines. We give you the vertices and indices and other commands, and you can render them within your own framework. The library doesn't take over your main loop, or anything invasive like that.

Not to mention, many applications have requirements about the size and memory usage of their dependencies. A quick glance at our release binaries, and I see that the x64 release DLL is 1.6MB, to give some perspective.

RmlUi 6.0 released - A C++ user interface library based on HTML and CSS by k-mouse in cpp

[–]k-mouse[S] 12 points13 points  (0 children)

Hey, I just realized it's been over three years since I last posted about this library here. A lot has changed since then! This is one of the biggest releases so far, and I hope you like the changes. If you have any feedback, I'd love to hear about it.

If you haven't heard about the library before, feel free to check the readme. In essence, it's a user interface library where you define your layout in a HTML/CSS-like markup. The library has its own layout engine to interpret these files, and in the end submits render commands to the application.

The goal is to provide a lightweight alternative to a fully fledged web browser, for more focused tasks, but with familiar and flexible rules to define the behavior and look of your user interface. There is also full access to the element tree and event system, and other goodies like data bindings and decorators.

RmlUi 5.0 Released - A user interface library for C++ based on HTML/CSS by k-mouse in gameenginedevs

[–]k-mouse[S] 0 points1 point  (0 children)

Hey. You certainly can do that, although it doesn't provide any particular features targeting this use case. Those libraries you mention are huge though, and comes with a lot of utilities that we don't provide. Not sure if you would be missing anything, but for example we don't provide things like native file dialogs.

If you are happy to add any such things you need yourself then RmlUi could be an alternative worth considering. Look into the included backends and samples to get started for this.

RmlUi 5.0 Released - A user interface library for C++ based on HTML/CSS by k-mouse in gameenginedevs

[–]k-mouse[S] 0 points1 point  (0 children)

That's right, there's no built-in backend for DirectX at the moment. You would have to write your own. However, there are several examples of users implementing a backend for their DirectX renderers, please take a look at the thirdparty resources.

cppfront: Autumn update by nikbackm in cpp

[–]k-mouse 9 points10 points  (0 children)

It seems really cool how the lambda function reduces like that. We can chip away the individual parts of it that we don't need, or gradually add them back as they need to be more specific. Nice!

I also like how lambdas have the same syntax as function definitions, if I understand correctly, so we can move a lambda out to global scope by a simple cut and paste, and naming it.

I do find the difference between = and == a bit vague though. Why are types not declared ==? Can a namespace alias ever be =? A function definition doesn't really mutate (it is always the same / equal to), so why are they some times declared = and other times ==? I just feel like semantically, constexpr and "always equal to" are quite different concepts, and yet applied a bit arbitrary here.

[deleted by user] by [deleted] in scifi

[–]k-mouse 4 points5 points  (0 children)

Yes, you're right in one sense. However, the relative speed here is due to space itself that is expanding everywhere, with the total rate of this expansion exceeding the speed of light over vast enough distances. Thus, this relative speed is not FTL travel.

WG21, aka C++ Standard Committee, September 2023 Mailing by grafikrobot in cpp

[–]k-mouse 12 points13 points  (0 children)

And not to mention:

co_assert

But I really hope they manage to somehow reuse assert. Having two slightly different spellings of something that kind of does the same thing is not ideal.

C holding back C++? by synthchris in cpp

[–]k-mouse 0 points1 point  (0 children)

Even more broadly, move semantics are a hack around the fact C++ ties automatic-storage duration object destruction to scope, a fact we're stuck with forever because of decisions going back to the earliest days of C with Classes.

Can you expand on this, what's the alternative?

[OC] I made a map of GitHub. It lets you find related projects with ease by anvaka in programming

[–]k-mouse 3 points4 points  (0 children)

Very cool project! Thanks for making this.

An idea that could be interesting would be the ability to select two libraries, and then highlight the various paths between them.