Setting and Getting individual pixel colours

Post Reply
steaky1212
Posts: 6
Joined: Thu Jun 04, 2009 6:25 pm

Setting and Getting individual pixel colours

Post by steaky1212 » Tue Jun 30, 2009 4:16 pm

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

Samson
Posts: 35
Joined: Mon May 19, 2008 8:05 am

Re: Setting and Getting individual pixel colours

Post by Samson » Sat Jul 11, 2009 6:59 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests