CE-Programming / libraries

Common libraries for use on the TI84+CE/TI83PCE calculators
BSD 2-Clause "Simplified" License
141 stars 11 forks source link

gfx_vbuffer and gfx_vram #35

Closed WyvernDotRed closed 5 years ago

WyvernDotRed commented 5 years ago

My program uses a pointer to write manually to the graphics buffer. But when I use ptr = gfx_vbuffer; I get ERROR (152) Operands are not assignment compatible. ptr = gfx_vram; works just fine, and because their description on the graphx.h File Reference is almost exactly the same, this seems strange to me. Am I missing something or is this some sort of compiler or library issue? I am using the CE toolchain with I believe an up-to-date version.

jacobly0 commented 5 years ago

That's because gfx_vbuffer was meant to be used like gfx_vbuffer[y][x] = index;. If you actually want a pointer you can do uint8_t *ptr = &gfx_vbuffer[0][0]; which is the address of the first pixel and equivalent to uint8_t *ptr = gfx_vbuffer[0]; which is an array containing the first row of pixels decaying to a pointer to its first element.