Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification re: glyph map #2

Open
nageebt opened this issue May 25, 2022 · 1 comment
Open

Clarification re: glyph map #2

nageebt opened this issue May 25, 2022 · 1 comment

Comments

@nageebt
Copy link

nageebt commented May 25, 2022

I'm trying to test your fabulous work to see if it would allow me to pass in a single frame represented by an array of pixel values. I'm using your the matrix code but am having issues understanding how the glyphs work and what the glyph array is supposed to do. (The code only displays a black screen for me as the esp_random() function isn't found)

Can you describe what the glyph map is and how it represents data to be displayed? From the code it appears to be a sequence of bytes representing characters but I can't tell for sure.

@kgsws
Copy link
Owner

kgsws commented May 25, 2022

GlyphMap is a 2bpp image with a resolution of 160x32. It contains 40 characters with resolution of 8x16.
This was just a fast way to produce simple font system for me. You don't need this to use the screen.

Functions 'gblcd_output_init' (called only once) and 'gblcd_swap_buffers' will return a frame buffer pointer for you to fill with whatever you want to display. It's always 160x144, 2bpp. That makes it 5760 bytes long. Since it's a 2bpp pixel format, one byte equals to 4 pixels.

The code uses double-buffering so you must use 'gblcd_swap_buffers' after you fill the framebuffer to update the screen. It will give you new pointer that you have to use next.
Also, this function is blocking (waiting for VBlank) to avoid tearing effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants