2

What I'd like to do, in the simplest way possible, is to get a simple framebuffer like object to write to.

To elaborate, I'd like to be able to just write code like

typedef struct {
   ...
   uint32_t stride; // Number of items to skip to get to same pixel on row below
   uint32_t *pixels; // Pixel data
   ...
} framebuffer_thing;

#define PX(x,y) ((stride * (y))+(x))

void updateFb(framebuffer_thing);

myfunc(framebuffer_thing f) {
  for(i=0;i<100;i++) f.fb[PX(10+i,20+i)]=0xff000000+i*0x00010000; // To write pixels into my buffer
  updateFb(f); // To update the display if necessary
}

and ideally, I'd also like to have it interactively useable from Python. Does anybody know of code that does this that already works, or how to go about writing it?

4

0 回答 0