Hardware Agnostic Graphics Library
Hardware Agnostic Graphics Library
HAGL is a lightweight hardware agnostic graphics library. It does not contain any hardware specific code. You can use it with any microcontroller including ESP32 and esp-idf. I have been working on and off with it for a while, mostly to scratch my own itch. It can still be considered work in progress. However API should be 90% stable.
Being hardware agnostic means user has to provide a HAL. Minimal HAL can provide only a putpixel function. There is a HAL for ESP32 which supports most hobbyist displays. There is also an SDL2 HAL for normal computers. You can use the latter to develop graphics code on your laptop.
For example when I was doing the Old school demo effects I first coded them on my laptop. When I was happy with the effects I used the same code for ESP32. I also did some other proof of concepts with the library such as ESP video player.
I would appreciate some feedback about the API and the library in general. I try to keep things fairly low level.
Re: Hardware Agnostic Graphics Library
This is awesome! Great job!
Future improvement suggestions:
* font character / pixmap collision detection. Throw an exception or errval if any non-0 portion of character/pixmap collides with something in the buffer. This would allow for GAMES!
* character rotation. Fast rotation: 90* increments. Slow rotation: any other angle increments.
Custom "player/missile" fonts would be possible for fast mini-games! (Yeah, I grew up with an Atari 8-bit system)
Future improvement suggestions:
* font character / pixmap collision detection. Throw an exception or errval if any non-0 portion of character/pixmap collides with something in the buffer. This would allow for GAMES!
* character rotation. Fast rotation: 90* increments. Slow rotation: any other angle increments.
Custom "player/missile" fonts would be possible for fast mini-games! (Yeah, I grew up with an Atari 8-bit system)
Re: Hardware Agnostic Graphics Library
Yeah. Also need to support transparent background color with fonts. I have been pondering if there should be separate functions for fonts and sprites. Sprites would act similar to way you described.
Check the UNSCII font. You might like it
Custom "player/missile" fonts would be possible for fast mini-games! (Yeah, I grew up with an Atari 8-bit system)
Check the UNSCII font. You might like it
Re: Hardware Agnostic Graphics Library
Nice fonts! "unscii-8-fantasy" reminds me of the font used in the "Alternate Reality" 8-bit game!
Agreed. Fonts and sprites should be different, but font characters should be able to be used as sprites, too! I see space invaders in those fonts!
Agreed. Fonts and sprites should be different, but font characters should be able to be used as sprites, too! I see space invaders in those fonts!
Who is online
Users browsing this forum: No registered users and 38 guests