diff --git a/graphics/simplegfx/source/main.c b/graphics/simplegfx/source/main.c index 17abb8d..7f780a2 100644 --- a/graphics/simplegfx/source/main.c +++ b/graphics/simplegfx/source/main.c @@ -2,71 +2,52 @@ #include #include -#include "image_bin.h"//Your own raw RGB888 1280x720 image at "data/image.bin" is required. - //See also libnx gfx.h. int main(int argc, char **argv) { - u8 *framebuf; - u32 *framebuf32; - u32 width=0, height=0; - u32 image_width = 1280, image_height = 720; - u32 tmp_width, tmp_height; - u32 x, y; - u32 j; - u32 pos; - u32 pos2; - u8 *imageptr = (u8*)image_bin; - u32 cnt=0; + u32* framebuf; + u32 cnt=0; - //gfxInitResolutionDefault();//Enable max-1080p support. Remove for 720p-only resolution. - gfxInitDefault(); - //gfxConfigureAutoResolutionDefault(true);//Set current resolution automatically depending on current/changed OperationMode. Only use this when using gfxInitResolution*(). - //Note that while the above commented code enables 1080p for docked-mode, this example only draws a 720p image, with the rest of the screen being left at white. + //Enable max-1080p support. Remove for 720p-only resolution. + //gfxInitResolutionDefault(); - while(appletMainLoop()) - { - //Scan all the inputs. This should be done once for each frame - hidScanInput(); + gfxInitDefault(); - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_PLUS) break; + //Set current resolution automatically depending on current/changed OperationMode. Only use this when using gfxInitResolution*(). + //gfxConfigureAutoResolutionDefault(true); - framebuf = gfxGetFramebuffer((u32*)&width, (u32*)&height); - framebuf32 = (u32*)framebuf; + while(appletMainLoop()) + { + //Scan all the inputs. This should be done once for each frame + hidScanInput(); - if(cnt==60) - { - cnt=0; - } - else - { - cnt++; - } + if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_PLUS) break; - tmp_width = image_width; - tmp_height = image_height; - if(tmp_width > width) tmp_width = width; - if(tmp_height > height) tmp_height = height; + u32 width, height; + framebuf = (u32*) gfxGetFramebuffer((u32*)&width, (u32*)&height); - memset(framebuf, 0xff, gfxGetFramebufferSize()); - for(x=0; x