Investigate which graphics library to use
Opened this issue · 11 comments
Currently, glium is used. This is not necessarily a good choice. If we are going to switch, we should do it sooner rather than later. Points to consider:
- ease of using widgets, menus, file-open dialogs etc. (provided by GTK or other toolkits),
- portability,
- simpliticy,
- speed (a non-issue for most Rust libraries).
There is wxWidgets, a newer alternative to GTK and QT, which is described in their FAQ as follows:
What is wxWidgets?
wxWidgets is a class library that allows you to compile graphical C++ programs on a range of different platforms. wxWidgets defines a common API across platforms, but uses the native graphical user interface (GUI) on each platform, so your program will take on the native 'look and feel' that users are familiar with.
There's also a Rust binding for it.
Since none of those three are Rust, and they do appear to be the range of choices (since Conrod is not much better than Glium, for our purpose here, of serious development), then I'd give wxWidgets a look.
For the student, seeing this as both an opportunity to learn and a career/business development, it comes down to QT or, perhaps, wxWidgets because of their wider applicability than GTK.
I think that in practice, wxWidgets is quite ugly (Audacity). Qt is great, but the Rust bindings are not there.
If we used the rendering capabilities of a said library, how much code could actually be re-used? It may be just src/core.rs
. In that case, it might be easier to just fork/start a new project. And maybe we should not do our own rendering, since it is just extra work and it is not terribly likely that we will need to render 3D meshes inside our editor (motion blur is probably unnecessary, too :-) ).
@potocpav wxWidgets uses GTK+ controls under the hood (on linux), I'm pretty sure it can be themed too.
Please also consider the native win32 support it has.
The latest xi_gilum using GTK3 is bugged on Windows btw.
@DemonOne OK, I will play with wxWidgets, maybe create a branch if I get the bindings working in a reasonable way.
About the Windows support, GTK3 needs Cairo, GTK+ and GLib on the system, so that might be the problem.
@potocpav I had to get the entire GTK3 runtime for win32 before I could even build xi_gilum (a little less than 300MB).
Anyway, the program loads and displays the main window and you can see the RPC working, but the text isn't displayed.
What does servo use?
It might be that a pure rust implementation is Linux only until one of the GUI libraries matures.
Servo uses azure / gleam for webrender (raw OpenGL). GTK should be an optional feature for now, since it is so much hassle on Windows.
libui could be a possibility. There are some old Rust bindings too
https://github.com/cyndis/qmlrs is nice but not active.