mirror of
https://github.com/switchbrew/switch-examples.git
synced 2025-06-21 21:32:40 +02:00
Access the framebuf in simplegfx linearly and moved a comment.
This commit is contained in:
parent
3d9851145a
commit
4f743f49ad
@ -45,17 +45,16 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Each pixel is 4-bytes due to RGBA8888.
|
//Each pixel is 4-bytes due to RGBA8888.
|
||||||
//Set framebuf to different shades of grey.
|
|
||||||
u32 x, y;
|
u32 x, y;
|
||||||
for (x=0; x<width; x++)
|
for (y=0; y<height; y++)//Access the buffer linearly.
|
||||||
{
|
{
|
||||||
for (y=0; y<height; y++)
|
for (x=0; x<width; x++)
|
||||||
{
|
{
|
||||||
pos = y * width + x;
|
pos = y * width + x;
|
||||||
#ifdef DISPLAY_IMAGE
|
#ifdef DISPLAY_IMAGE
|
||||||
framebuf[pos] = RGBA8_MAXALPHA(imageptr[pos*3+0]+(cnt*4), imageptr[pos*3+1], imageptr[pos*3+2]);
|
framebuf[pos] = RGBA8_MAXALPHA(imageptr[pos*3+0]+(cnt*4), imageptr[pos*3+1], imageptr[pos*3+2]);
|
||||||
#else
|
#else
|
||||||
framebuf[pos] = 0x01010101 * cnt * 4;
|
framebuf[pos] = 0x01010101 * cnt * 4;//Set framebuf to different shades of grey.
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user