Ultralight

repository·master·Indexed 26 days ago

https://github.com/ultralight-ux/ultralight

A lightweight, high-performance HTML/JS/CSS renderer for C/C++ developers to integrate web content into games and desktop applications. It features a platform-agnostic WebKit-based solution with customizable CPU (Skia-based) and GPU rendering paths. The SDK supports Windows, Linux, and macOS, and includes AppCore for native window management in desktop apps.

Tokens
4.6K
Snippets
8
Records
29
Agent score
90%

What's inside Ultralight

  1. Overview of GLFW

    master

    GLFW is an open-source, multi-platform library designed for OpenGL, OpenGL ES, and Vulkan application development. It provides a platform-independent API for:

    • Creating windows, contexts, and surfaces
    • Reading input
    • Handling events

    Supported platforms include Windows, macOS, and Linux/Unix-like systems. Experimental support is available for the Wayland protocol and the Mir display server.

  2. Understand Ultralight Licensing

    master

    Ultralight uses a dual-licensing model:

    • Free License:
      • For non-commercial use.
      • For commercial use by indie companies with < $100K annual revenue.
      • Includes the full SDK.
    • Commercial License:
      • Required for larger commercial entities.
      • Includes performance tools, extra configurations, and source code.
      • Contact the team for enterprise licensing and volume discounts.
  3. Choose a renderer: CPU vs GPU

    master

    Ultralight provides two distinct rendering paths depending on your integration needs:

    CPU Renderer

    • Best for: Fast, lightweight, and easy integration.
    • Output: Renders to a 32-bit BGRA pixel buffer.
    • Technology: Based on Skia, accelerated via multi-threaded SIMD.
    • Reference: See the Game Integration Guide.

    GPU Renderer

    • Best for: High-performance, customizable, and portable applications requiring high animation performance.
    • Output: Renders directly to a GPU texture.
    • Technology: Accelerated via tesselated geometry and pixel shaders.
    • Reference: See Using a Custom GPUDriver.
  4. Integrate Ultralight into Games or Desktop Apps

    master

    Ultralight offers different integration paths based on your target application type:

    For Game Developers

    Designed for high-performance web-content in game engine environments. You can choose between the CPU renderer for reliability or the GPU renderer for animation performance.

    For Desktop-App Developers

    Allows you to build front-ends with HTML/CSS/JS while using C/C++ for logic. You can either:

    1. Embed the renderer directly within your existing run loop.
    2. Use AppCore, an optional desktop app runtime that provides convenient native window management and accelerated rendering.
  5. Report a GLFW bug

    master

    When reporting unexpected run-time behavior, first set an error callback to identify the cause. If the library is crashing or triggering asserts, verify that all object handles and pointers are valid.

    Guidelines for bug reports:

    • Provide a short, self-contained code example inline if possible.
    • Provide all information as text, not images (use triple backticks for code blocks).
    • Use issue labels for platforms and GPU manufacturers instead of including them in the subject line.
  6. Report a window, input, or event bug in GLFW

    master

    Note that window moving/resizing by a user may block the main thread on some platforms; use a refresh callback to keep contents updated. For X11 users, please include your desktop environment (GNOME, KDE, etc.) and window manager.

    Use the events tool (found in tests/events.c in the source tree) to print all information provided to every GLFW callback. Include this output in your report.

    Include the following in your report:

    • OS and version
    • GLFW release version or commit ID
    • Error messages from the error callback
    • The output of the events tool.
    • If using a Virtual Machine, include the VM name and version.

    Use the following template:

    OS and version:
    Release or commit:
    Error messages:
    events output:
  7. Contribute a feature

    master

    When contributing a new feature, ensure you have the necessary intellectual property rights. Before implementation, check for existing open issues or experimental branches. A complete feature contribution includes:

    • The code implementation.
    • A change log entry in README.md listing all new symbols.
    • A news page entry briefly describing the feature.
    • Guide documentation with minimal examples.
    • Reference documentation with all applicable tags.
    • Cross-references and mentions in appropriate places.
    • Credits entries for all authors.

    Platform and Testing Requirements:

    • Platform-specific code: If the feature requires platform-specific code, you must add stubs for the new platform function to all supported and experimental platforms.
    • New Callbacks: Support must be added to tests/event.c.
    • New Monitor Properties: Support must be added to tests/monitor.c.
    • New Graphics Options/Extensions (OpenGL, OpenGL ES, or Vulkan): Support must be added to tests/glfwinfo.c and the behavior when the extension is missing must be documented in docs/compat.dox.

    API Stability Note: Any part of the public API included in a release cannot be changed until the next major version. Code written to the API of one minor release must both compile and run on subsequent minor releases.

  8. Compile GLFW

    master

    GLFW can be compiled on various platforms using the following compilers:

    • Windows: Visual C++ 2010 and later, MinGW, and MinGW-w64.
    • macOS: Clang.
    • Linux/Unix-like: GCC and Clang.

    GLFW only requires the headers and libraries for your window system; it does not require headers for context creation APIs (WGL, GLX, EGL, NSGL, OSMesa) or rendering APIs (OpenGL, OpenGL ES, Vulkan) to enable support for them.

    Pre-compiled Windows binaries are available for all supported compilers via the official GLFW downloads page.

  9. Report a monitor or video mode bug in GLFW

    master

    Note that on some headless systems, glfwGetPrimaryMonitor may return NULL. Additionally, GLFW only reports video modes approved by the OS; this is intended behavior.

    Use the monitors tool (found in tests/monitors.c in the source tree) to list all information GLFW provides about detected monitors. Include this output in your report.

    Include the following in your report:

    • OS and version
    • GLFW release version or commit ID
    • Error messages from the error callback
    • The output of the monitors tool.
    • If using a Virtual Machine, include the VM name and version.

    Use the following template:

    OS and version:
    Release or commit:
    Error messages:
    monitors output: