Page 1 of 1

Setting and Getting individual pixel colours

Posted: Tue Jun 30, 2009 4:16 pm
by steaky1212
Hi,

I dont know where this is supposed to be posted but here goes.

Is there the function to set individual pixel values, and also read back from the display.

Thanks
steaky

Re: Setting and Getting individual pixel colours

Posted: Sat Jul 11, 2009 6:59 pm
by Samson
In general: you don't want to do that. If you want to draw sprites or glyphs for text it is much more efficient to store them as texture and draw screen-aligned quads. If you want to draw the result of some software rendering process it may still be more efficient to render into a texture and draw a quad.
If you REALLY have to draw individual pixel you've got two choices:
- draw into the external framebuffer. That's a bit tricky, because colours are are stored in YUV. But you can just poke values into the memory occupied by the active frame, and it will be visible immediately. Remember to flush your cache when you're done!
- draw into the embedded framebuffer.

Code: Select all

void GX_PokeARGB(u16 x,u16 y,GXColor color);
void GX_PokeZ(u16 x,u16 y,u32 z);
You're still responsible for copying the result into the external framebuffer when you're done.