X-Git-Url: http://git.mutantstargoat.com?p=winnie;a=blobdiff_plain;f=src%2Ffbdev%2Fgfx.cc;fp=src%2Ffbdev%2Fgfx.cc;h=99844220e8b6d5cdb77c1d396db7babee217e0e0;hp=d0a81788b3431eb3067ceb778189b599b67311bf;hb=2a5665e9005d05c8d30747f1fcb2c41d0a8f27c8;hpb=7f256d5ad4144c1f4169d684ce13a3d414d09913 diff --git a/src/fbdev/gfx.cc b/src/fbdev/gfx.cc index d0a8178..9984422 100644 --- a/src/fbdev/gfx.cc +++ b/src/fbdev/gfx.cc @@ -30,6 +30,10 @@ static Graphics *gfx; bool init_gfx() { + if(!(gfx = (Graphics*)malloc(sizeof *gfx))) { + return false; + } + gfx->dev_fd = -1; if((gfx->dev_fd = open("/dev/fb0", O_RDWR)) == -1) { @@ -45,10 +49,6 @@ bool init_gfx() return false; } - if(!(gfx = (Graphics*)malloc(sizeof *gfx))) { - return false; - } - printf("width : %d height : %d\n : bpp : %d\n", sinfo.xres, sinfo.yres, sinfo.bits_per_pixel); printf("virtual w: %d virtual h: %d\n", sinfo.xres_virtual, sinfo.yres_virtual);