[graphics] implement raylib-based canvas [draft] - #23043
Conversation
Test Results 2 files 2 suites 2h 15m 12s ⏱️ Results for commit 4001e08. ♻️ This comment has been updated with latest results. |
Provide three main classes: - TRaylibCanvas - canvas implementation for raylib - TRaylibPadPainter - actual painting of the root graphics with raylib - TRaylibGuiFactory - entry point, creates canvas implementation raylib event loop runs with timer and processed every 10 ms Actual painting performed in the TCanvas::Update() method Fonts loading not works. Basic primitives are implemented
When window resized - resize canvas When window closed - confirm and stop painting When canvas->Show() - show hidden window again Trigger in EventsTimer canvas update
While raylib does not have own method to correctly fill generic polygon, add earcut.hpp from https://github.com/mapbox/earcut.hpp
Use texture for graphics rendering. It updated when canvas is modified and then just painted on the window - when necessary. Decouple ROOT graphics and raylib paint loop. Provide File menu prototype
| @@ -0,0 +1,6460 @@ | |||
| /******************************************************************************************* | |||
| * | |||
| * raygui v5.0 - A simple and easy-to-use immediate-mode gui library | |||
There was a problem hiding this comment.
Cool!
This file could go into builtins/raygui/
and then from CMakeLists just target_include_directories(ROOTRaylibCanvas PRVIATE ../../builtins/raygui)
There was a problem hiding this comment.
I don't think we actually want to merge this, it's (as far as I understand) a proof of concept meant to guide the evolution of the interface for TCanvas/PadPainter/etc
There was a problem hiding this comment.
It is demo that API works with absolutely different gui/graphics framework.
raylib is not very popular in HEP community.
I want to make it to the point that it can be compiled and used with regular ROOT installation.
handle raylib drawing inside TRaylibCanvas class Use internal class members instead of global/static variables
raylibis very compact graphics library.Just use it as basic demo how canvas can be implemented with it.
With some help of AI working code was generated within one day.
One can consider it just as demonstrator.
Still missing: