Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not found the backend any header files #690

Open
SHIINASAMA opened this issue Oct 8, 2024 · 15 comments
Open

Can not found the backend any header files #690

SHIINASAMA opened this issue Oct 8, 2024 · 15 comments
Labels
backends Platforms and renderers build Build system and compilation

Comments

@SHIINASAMA
Copy link

Hello, I'm new to this project.

When I tried to install the library using vcpkg (both in classic mode and manifest mode), I found that backend related header files were not installed.

I'm wondering if this is a bug, or if it matches the originally expected behavior.

When using imgui, this allows the selection of the corresponding backend via vcpkg features, would rmlui also be able to implement such a convenient feature?

@wh1t3lord
Copy link
Contributor

The convenient way of integration like in imgui library will be implemented in future versions of RmlUI. From now it is supposed that user uses files and re-write backend for their own needs as they wish.

@SHIINASAMA
Copy link
Author

It's good to see that the community has plans to work on this feature.

I've done something similar on my own project using vcpkg features to control the backend implementation, which is very user friendly and looking forward to this feature.

Can I ask if this will be part of a major release or will it be released as a patch or fix?

@wh1t3lord
Copy link
Contributor

It is better to ask the owner @mikke89

@mikke89 mikke89 added build Build system and compilation backends Platforms and renderers labels Oct 9, 2024
@mikke89
Copy link
Owner

mikke89 commented Oct 9, 2024

Yeah, right now we don't expose the backends on vcpkg. Could be a nice thing to be able to opt in to, certainly. We don't have any specific plans to implement this, although I mean, vcpkg is all open for anyone to contribute to ;)

I wonder what some good approaches are with this, how does this work with dear imgui? Does it just integrate each selected backend into the main library, or does it export separate libraries for each backend?

@SHIINASAMA
Copy link
Author

SHIINASAMA commented Oct 10, 2024

Based on my understanding and experience, ImGui packages different backends into the main library through compilation options and installs the header files.

If you want to do this, I personally recommend integrating Vcpkg manifest mode into the project. First, this greatly simplifies the deployment process for developers, and secondly, it helps us organize other dependencies. Of course, this is an optional approach and just my suggestion.

With the manifest mode, dependencies are imported as needed, and for some packages, we may need to provide a custom port (such as rlottie). You can use the existing build options to add VCPKG_MANIFEST_FEATURES, which won’t disrupt the original build process.

e.g.

https://github.com/libsese/sese/blob/ec0fed6480322510ef1ea140ef9e28afb1511a85/cmake/MiniSeseTools.cmake#L1

https://github.com/libsese/sese/blob/ec0fed6480322510ef1ea140ef9e28afb1511a85/CMakeLists.txt#L9

https://github.com/libsese/sese/blob/ec0fed6480322510ef1ea140ef9e28afb1511a85/CMakeLists.txt#L26

@SHIINASAMA
Copy link
Author

I tried packaging rlottie and integrating vcpkg and so far it seems to work out of the box!

2024-10-1114-37-08-ezgif com-video-to-gif-converter

This doesn't make any destructive changes, it just adds the vcpkg configuration file.

https://github.com/SHIINASAMA/RmlUi

@SHIINASAMA
Copy link
Author

@SHIINASAMA I mean, with this step, integrating the backend as featues is totally possible!

@mikke89
Copy link
Owner

mikke89 commented Oct 13, 2024

Based on my understanding and experience, ImGui packages different backends into the main library through compilation options and installs the header files.

I see, we could do something like this. I wonder if bundling the backends could be done entirely on the vcpkg repository side. But if there is something specific needed on the library side, I'm open to that as well.

Adding a vcpkg manifest would only help in testing and developing the library, I believe. Building it with vcpkg right now is 5 commands listed on the readme, so I don't think it contributes that much. And the downside is that we have to replicate the manifest that now exists in the vcpkg repo.

I would really encourage you to add the rlottie port to the vcpkg repository though! That would be super helpful, one could then add support for RmlUi's lottie plugin too. See e.g. the addition of the SVG plugin which was nicely contributed recently: microsoft/vcpkg#40748

@SHIINASAMA
Copy link
Author

Adding a vcpkg manifest would only help in testing and developing the library, I believe. Building it with vcpkg right now is 5 commands listed on the readme, so I don't think it contributes that much. And the downside is that we have to replicate the manifest that now exists in the vcpkg repo.

Yes, this is only optional, but I had to do it in order to demonstrate the use of packages that were not merged into the vcpkg built-in library.

I would really encourage you to add the rlottie port to the vcpkg repository though! That would be super helpful, one could then add support for RmlUi's lottie plugin too. See e.g. the addition of the SVG plugin which was nicely contributed recently: microsoft/vcpkg#40748

This takes some time, including packaging, licensing, and submitting for review. the rlottie project itself is a bit unique in that it hasn't been released in a long time, with the last version being V2.0, but the ports I've packaged are actually based on the latest commits.

@SHIINASAMA
Copy link
Author

Waiting to be merged...

microsoft/vcpkg#41567

@mikke89
Copy link
Owner

mikke89 commented Oct 19, 2024

Oh, that's great! Thanks a lot, appreciate the effort you put in here.

@SHIINASAMA
Copy link
Author

rlottie has been merged microsoft/vcpkg#41890

@mikke89
Copy link
Owner

mikke89 commented Nov 2, 2024

Awesome, great work!

I just tested installing it through vcpkg, and use it with RmlUi, and it just worked without any extra effort. That's really nice.

I've updated the documentation to reflect this change, and also updated the readme. I guess the next logical step for us is to add the plugin as a feature to RmlUi in the vcpkg repository. And it would also be nice with all the backends.

Looking over the imgui port, I see that they provide an option for each of their backends. And then as I understand it, the user would have to tie them together to actually get a window. The equivalent for us would be to provide an option for each of the renderers and platforms, but not the backends tying them together. I think that makes the most sense for us, as the backends themselves are mainly intended as examples, or starting points.

@SHIINASAMA
Copy link
Author

Yes, this is exactly the effect I hope to achieve: users shouldn't have to deal with complex configurations. After installing with vcpkg, they shouldn't need to worry about environment-related issues.

I learned about this library on Telegram, and I'm pleasantly surprised that I can contribute as well. I look forward to seeing further improvements in this library ❤️.

@mikke89
Copy link
Owner

mikke89 commented Nov 2, 2024

Thank you, that means a lot! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backends Platforms and renderers build Build system and compilation
Projects
None yet
Development

No branches or pull requests

3 participants