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

Evaluate available 2D overlay options #19

Open
9 tasks
hnkb opened this issue Oct 5, 2019 · 2 comments
Open
9 tasks

Evaluate available 2D overlay options #19

hnkb opened this issue Oct 5, 2019 · 2 comments

Comments

@hnkb
Copy link
Owner

hnkb commented Oct 5, 2019

Options include:

  • Embed HTML browser
  • Use a third-party multi-platform 2D library
  • Use custom simple Box model for layout and 2D object hierarchy, and implement a Direct2D implementation for now
    • How can we use this with OpenGL? On Windows, theoretically, we can draw Direct2D output to texture and use it in OpenGL. But what about other platforms? For OpenGL font support, also see this.
    • Use SVG, it might even be possible to use Direct2D native SVG support

HTML UI is excellent, but might be too slow (chromium DLL itself is many tens of megabytes large). Ultralight claims to be fast (must be tested), and is designed explicitly for our scenario, but its license is restrictive. So we may want to also check out a more generic CEF-based solution.

In case of slow performance from HTML renderer, we can also add a simple 2D language ourself, to be fast and reduce dependencies. This should not be very complex, because for more complex scenarios we always have a full-fledged HTML browser.

@hnkb hnkb modified the milestones: 2D overlays, Re-launch as library Oct 5, 2019
@hnkb
Copy link
Owner Author

hnkb commented Oct 5, 2019

If custom 2D objects is chosen, I will need to then create an issue with these steps:

  • Hierarchy of Box objects, with optional absolute or relative sizing (and HTML-like auto-size?)
  • Mouse hit-testing to send mouse events to correct box
  • Keyboard focus for boxes
  • Button
  • Hyperlink
  • TextBox
  • Image with zoom / pan
  • CSS-like attributes and animation

@hnkb
Copy link
Owner Author

hnkb commented Jul 26, 2020

Basic feedback I get from Ultralight and Sciter is that they are certainly fast enough and can be integrated into 3D pipeline. Sciter has a very liberal license and performs really well. It is also very easy to integrate into C++ and communicate with DOM from C++, but has some usability issues which limit its usefulness. Its DOM and CSS have some browser-incompatibilities and it has its own scripting language instead of Javascript. This means that there is little possibility of supporting both web and app from the same code base.

To achieve the best possible web/app harmony, I think it is best to provide an internal HTTP server in the C++ side to communicated with an otherwise web-like HTML DOM/CSS and this is probably easier achieved with Ultralight.

Don't forget that a third option also exists (how acceptable is it?) to have a complete web site with WebGL inside an electron instance.

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

No branches or pull requests

1 participant