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

Add example to use libRmlUi with SDL2 SDL_Renderer / SDL_RenderGeometry #252

Merged
merged 2 commits into from
Dec 28, 2021
Merged

Add example to use libRmlUi with SDL2 SDL_Renderer / SDL_RenderGeometry #252

merged 2 commits into from
Dec 28, 2021

Conversation

1bsyl
Copy link

@1bsyl 1bsyl commented Nov 7, 2021

for request #250
@baidwwy
I've updated the sample done for libRocket to match RmlUI sample/basics/sdl2
quickly tested.

@baidwwy
Copy link

baidwwy commented Nov 8, 2021

That’s great. Thanks

Copy link
Owner

@mikke89 mikke89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting, thank you!

Not sure how to handle this with regard to the CMake list. I guess it can be a bit confusing wrt. to the old SDL2 sample. Maybe rename the old one to eg. SDL2OpenGL, and add this as a separate sample? And further we should only enable this new one after testing the SDL version, after this has had a release.

Let me know if any of you have thoughts in this regard. For now it should be perfectly fine to merge it as is (after fixing the minor suggestions), and we can work on the CMake and sample things later, cheers!

Samples/basic/sdl2_sdlrenderer/src/RenderInterfaceSDL2.cpp Outdated Show resolved Hide resolved
Samples/basic/sdl2_sdlrenderer/src/main.cpp Outdated Show resolved Hide resolved
- change window title
@1bsyl
Copy link
Author

1bsyl commented Nov 11, 2021

I've just update the PR.
SDL2 is expected to be released soon, so you'll be able to try it.
Then fell free to change whatever you want.

@mikke89
Copy link
Owner

mikke89 commented Nov 11, 2021

Perfect, thanks! I'll hold on with merging until I've had a chance to test with the release of the next version of SDL2.

@aquawicket
Copy link
Contributor

aquawicket commented Dec 20, 2021

Firstly, thank you 1bsyl for providing this path and your help over at SDL. I went ahead dove into this and it works. So far, I've made a few fixes. Changed from using viewports to raw position drawing. Removed OpenGL hints so D3D, Metal and Vulkan can take control. Pulled in the Shell File Interface as part of the base code. Images are working well. Also added gif animation support. I've run it successfully on Windows 10 x86 / x86_64 (opengl/d3d/Vulcan), Mac 11.5.2 x86_64 (Metal/opengl), Lxle Linux i386 (opengl), Ubuntu x86_64 (opengl), Raspberry Pi 4 armhf (opengles), and i'm currently working on iOS (metal/opengles) and Android (opengles). I created a separate repository to keep down the clutter here until we have a viable PR.
There is no CMake or build scripts as of yet, but it uses the same as the RmlUI/Samples/basic/sdl2 project, minus SDL2 addons (SDL_Image, SDL_tft, etc). don't mind the practice samples. Still early code, but looking very promising. SDL2RendererRml

@mikke89 mikke89 merged commit 8577a0b into mikke89:master Dec 28, 2021
@mikke89
Copy link
Owner

mikke89 commented Dec 28, 2021

@1bsyl Thanks again! This works for me, I'm also in the process of adding CMake integration.

@aquawicket Those enhancements sounds very interesting! I'm very much looking forward to the PR(s) ;)

@mikke89
Copy link
Owner

mikke89 commented Dec 28, 2021

For reference, see also SDL2 PR libsdl-org/SDL#4195.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants