Skip to content

Feature Request: Add an OpenGL ES Backend #9

Done

Description

@fanyi-wh

Feature Request: Add an OpenGL ES Backend

Summary

I would like to request support for an OpenGL ES backend in charttable, preferably targeting OpenGL ES 3.0 or later.

Currently, charttable provides GPU rendering backends such as Vulkan, Metal, and Direct3D 12. Adding OpenGL ES support would make charttable easier to integrate into embedded Linux systems and applications using Qt Quick.

Motivation

I am developing a marine navigation application based on Qt 5.15 and QML, running on Ubuntu Linux with X11.

The application already uses OpenGL ES for video rendering through QQuickFramebufferObject. I would like to integrate charttable as the chart rendering engine while keeping the existing Qt Quick OpenGL ES rendering pipeline.

Using the same graphics API for both video and chart rendering would simplify the integration and avoid the complexity of sharing GPU resources between Vulkan and OpenGL ES, such as exporting Vulkan images through DMABUF and importing them as EGLImages.

OpenGL ES is also widely supported by embedded GPUs, making it a useful backend for embedded Linux platforms.

Proposed Implementation

I would prefer an OpenGL ES backend that reuses charttable's existing rendering architecture and scene/layout pipeline, rather than introducing a separate chart rendering implementation.

The proposed backend would include:

  • OpenGL ES 3.0+ device and resource management.
  • Vertex and index buffer management (VBO, IBO, VAO).
  • Texture and sampler management.
  • Shader and rendering pipeline implementation.
  • Uniform buffer and texture binding.
  • Alpha blending and depth/stencil state management.
  • Rendering support for the existing chart, pattern, sprite, and SDF pipelines.

Ideally, the existing CPU-side geometry generation, layout, batching, and scene construction logic could remain unchanged.

External Render Target / Framebuffer Integration

An additional feature that would be particularly useful is the ability to render into an externally managed OpenGL ES framebuffer.

For example, Qt's QQuickFramebufferObject manages the framebuffer and its lifecycle. The host application would provide the framebuffer ID and dimensions, and charttable would render directly into that framebuffer using the current OpenGL ES context.

A possible API could look like:

typedef struct {
    uint32_t framebuffer;
    uint32_t width;
    uint32_t height;
} charttable_gles_target;

charttable_status charttable_render_gles(
    charttable* chart,
    const charttable_gles_target* target
);

This is only a suggested API design; I am open to other approaches that fit charttable's existing architecture better.

Ideally, this API would:

  • Use the host application's current OpenGL ES context.
  • Render into a caller-provided framebuffer.
  • Avoid creating or managing a native window or EGLSurface.
  • Avoid performing buffer swapping.
  • Support framebuffer resizing.
  • Clearly define OpenGL state ownership and restoration.
  • Support rendering on the thread that owns the OpenGL ES context.

This would allow charttable to be integrated as a native rendering component inside Qt Quick, with the chart displayed alongside other QML content and video widgets.

Target Environment

  • OS: Ubuntu Linux
  • Window system: X11
  • Qt: 5.15
  • UI: Qt Quick / QML
  • Graphics API: OpenGL ES 3.0+
  • Integration: QQuickFramebufferObject

Questions

  1. Is an OpenGL ES backend within the project's scope?
  2. Would the existing GPU abstraction and scene pipeline allow an OpenGL ES backend to be added without significant changes to the layout and rendering architecture?
  3. Would you be interested in accepting contributions for this backend?
  4. Is rendering into an externally managed framebuffer compatible with the current architecture, or would you recommend a different integration approach?

I believe OpenGL ES support would make charttable more accessible to embedded Linux applications and other Qt Quick-based projects.

Thanks for your work on charttable!

Activity

  1. beetlebugorg commented on Nov 30, 2026

    @beetlebugorg
    Owner

    Thank you for the well written feature request. This has been implemented in #10. Let me know if this works for you and then I'll merge and release.

  2. fanyi-wh commented on Nov 30, 2026

    @fanyi-wh
    Author

    Yes, It worked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions