r/AutoHotkey • u/bceen13 • 9d ago
v2 Tool / Script Share GpGFX - almost ready, complete GdiPlus Graphics library, easy to use API
Hey everyone!
For the past few months, I’ve been rebuilding the graphics
pipeline for AutoHotkey v2 from scratch. Creating smooth,
transparent, modern-looking desktop overlays.
AHK is slow they said. Check out this video:
GpGFX v1 Teaser https://www.youtube.com/watch?v=6QrcofcuR5U
I built **GpGFX** to change that. Here is a quick
50-second sneak peek of what’s possible!
## What is GpGFX?
**GpGFX** is a high-performance, graphics and HUD engine
for AutoHotkey v2.
It writes directly to 32-bit DIB memory (`Scan0`) with microsecond QPCSpin-wait frame pacing, delivering 144Hz/240Hz+ gaming overlays with near-zero CPU footprint.
## Why it’s great for Beginners:
Human-Readable API: You don't need to know Win32 APIs,
Device Contexts, or GDI+ internals. Creating a modern
layered window is as simple as:
```autohotkey
lyr := Layer(100, 50, "My HUD")
RoundedRectangle(0, 0, 30, 30, 9, "lime")
Text("Hello World", "White", 22).Center()
Render.Layer(lyr)
And resources are freed up automatically!
• Built-in Modern Design System: comes out-of-the-box with 7 curated pro themes (Catppuccin Mocha, Tokyo Night, Dracula, Cyberpunk, Nord) and anti-aliased typography. Color html tags support for texts. ( you can see it on the video )
• Instant Gaming overlays, hp bars can be updated with just a few lines of code.
Why it’s great for Advanced AHKers & Power Users:
• Hardware-Paced QPC Timing: x64 machine code (MCode) and microsecond QueryPerformanceCounter spin-wait frame pacing for jitter-free 144+ FPS rendering loops.
• Direct Scan0 DIB Pipeline: direct unmanaged memory pointers (pBits) allowing MCode PixelSearch.
• Reactive Signals & Data Binding: bind variables to UI elements with zero render loop boilerplate (shape.Bind(mySignal)), complete with smooth easing curves (EaseIn, EaseOut, Bounce, Spring physics).
• WorkerPool Multi-Core Architecture: ready for multi-process distributed rendering across CPU cores via shared RAM file mapping (FileMapping).
• Rich Layout & Measurement: integrated TextLayout engine with rich-text styling tags (, , color:#hex), dynamic tab stops, and exact character advance measurements without DllCalls.
Use Cases:
• Gaming: zero-lag custom crosshairs, status meters, cooldown timers, and telemetry HUDs.
• Desktop Tools: snappy to-do widgets, desktop clocks, volume/brightness bars, and toast notifications.
• Streamers & Creators: in-game alerts and custom desktop companion apps.
• Desktop modification
Release Status:
GpGFX will be 100% free and open source on GitHub. ( old version is clunky, the new one rocks! )
I’m currently putting the final touches on documentation and examples before the initial public release. Soon! I will upload videos as soon as I will have time.
I’d love to hear your feedback, feature ideas, or what kind of overlays you'd build with this! Drop your thoughts below!
2
u/HerewakaPa 5d ago
Aye this sounds cool! I like TextRender but it is not as performant as good-old Gdip-All in my experience.
Is 0.7.3 the new version or is not released yet?
2
u/bceen13 5d ago
I think I will share it today, v1.0.0, I will drop a pm.
I love textrender, in my humble opinion, it was designed for a specific purpose, use-case. It is a very performance and elegant app.
GpGFX allows you to sync with workers. I was able to squish 250 FPS easily with 4000 particles ( pies ) on a mid HD layer. While without workers it performs with 29 FPS.
For easier tasks you can simply, draw single frames or render layers.
Soon!
1
u/HerewakaPa 4d ago
"sync with workers" is a bit over my head lol. I just found with a simple HUD for rapid incoming data, TextRender was much higher CPU than Gdip-All. Definitely an impressive implementation though.
1
u/bceen13 3d ago
I released it: https://github.com/bceenaeiklmr/GpGFX You can check out the demos for simple huds.
1
u/HerewakaPa 3d ago
Incredible. AHKquake. Thanks so much for pushing AHK Gdip into the future. Can't wait to dig in to the ReadMe and examples this week. Muchos kudos!!
1
u/CharnamelessOne 4d ago
Looking forward to this big time. Feel like my question from last time may be answered by the finished product.
Are your workers separate AHK processes that are busy-looping QueryPerformanceCounter calls, and communicating with the user's main script via FileMapping? So there is no timing loop in the main script whose interruptibility by new pseudo-threads would be a concern?
Are you using Cebolla's FileMapping lib, or are you raw-dogging the API?
2
u/bceen13 3d ago edited 3d ago
Finally, I can provide an answer, this would be my solution: https://www.reddit.com/r/AutoHotkey/comments/1w1x6d7/gpgfx_v100_a_2d_graphics_rendering_engine_built/ or directly at https://github.com/bceenaeiklmr/GpGFX
I implemented a hybrid sleep mode, it feels fluid for me. Check out the demos, there are some new files in the demo dir.
JFYI u/HerewakaPa
1
u/cs_cast_away_boi 9d ago
v1 support? ..pls?
11
1
2
u/tronghieu906 9d ago
Interesting, I've been using gdi+ but it's not pleasant at all. ᥬ🤔ᩤ