potocpav / xi_glium

Glium-based front-end to the xi editor
MIT License
84 stars 13 forks source link

Investigate which graphics library to use #1

Open potocpav opened 8 years ago

potocpav commented 8 years ago

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:

Bluebird45 commented 8 years ago

Whatever it is, it should be as much Rust as possible, because the appeal of such an app being Rust from front to back is compelling in its novelty.

I am currently looking at Conrod but, alas, I find it has its own issues that I'm yet to overcome.

Bluebird45 commented 8 years ago

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.

potocpav commented 8 years ago

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 :-) ).

DemonOne commented 8 years ago

@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.

potocpav commented 8 years ago

@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.

DemonOne commented 8 years ago

@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.

disordinary commented 8 years ago

What does servo use?

disordinary commented 8 years ago

It might be that a pure rust implementation is Linux only until one of the GUI libraries matures.

potocpav commented 8 years ago

Servo uses azure / gleam for webrender (raw OpenGL). GTK should be an optional feature for now, since it is so much hassle on Windows.

potocpav commented 7 years ago

libui could be a possibility. There are some old Rust bindings too

vandenoever commented 7 years ago

https://github.com/cyndis/qmlrs is nice but not active.