DEV Community

Discussion on: GoGPU: A Pure Go Graphics Library for GPU Programming

Collapse
 
dave_73b515f1bcf8870 profile image
dave_73b515f1bcf8870

As soon as Text Rendering is available, I will be using this as the rendering engine for Bellina (a GUI library in Go).

Collapse
 
kolkov profile image
Andrey Kolkov • Edited

Thanks for your comment. Try github.com/gogpu/gg and the text rendering should work. There might be some bugs, but I've only tested it so far.

Collapse
 
andres36_f046592b42556601 profile image
ANDRES36

I'm also been working on a experimental GUI library, currently using raylib because I don't know GPU programming, how hard would it be to use gogpu compared to raylib? Raylib is great but it redraws everything and my library is meant to be a retained mode gui, I want to redraw only the updated regions to keep GPU usage low. reddit.com/r/raylib/comments/1puyi...

Thread Thread
 
kolkov profile image
Andrey Kolkov • Edited

Hi ANDRES36! Great to hear about your GUI library project!

Your approach with raylib is interesting. Here's a quick comparison:

  | Aspect               | raylib (your approach)   | gogpu/gg                                |
  |----------------------|--------------------------|-----------------------------------------|
  | Rendering            | Immediate mode           | Retained mode (scene graph)             |
  | Backend              | OpenGL                   | WebGPU (Vulkan/Metal/GLES)              |
  | Dependencies         | CGO (C library)          | Pure Go (zero CGO)                      |
  | GPU acceleration     | Via OpenGL               | GPU path rendering via Sparse Strips    |
Enter fullscreen mode Exit fullscreen mode

What gogpu/gg offers for GUI building (v0.14.0):

  • Scene graph with dirty region tracking (only redraw what changed)
  • Layers with per-layer opacity and independent transformations
  • Alpha masks for compositing effects (new in v0.14.0)
  • 29 blend modes (Porter-Duff + Advanced + HSL)
  • Fluent PathBuilder for shape construction

gogpu/ui (in planning):
We're designing a signals-based GUI toolkit on top of gogpu/gg. Think Angular/SolidJS reactivity but for native desktop apps. Enterprise features like docking, virtualization, accessibility are planned.

Your HTML/CSS reverse-engineering approach is clever! If you're interested in comparing notes or potentially collaborating on retained-mode patterns, join our discussion:
👉 github.com/orgs/gogpu/discussions/18

The Pure Go ecosystem means easy cross-compilation: GOOS=linux go build — no C toolchain needed.