Mercurial > hg > Game > Cerium
diff TaskManager/Test/test_render/viewerFB.cpp @ 109:028ffc9c0375 draft
Cerium cvs version
author | gongo@gendarme.local |
---|---|
date | Wed, 12 Nov 2008 17:39:33 +0900 |
parents | |
children | efd7e4712342 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/viewerFB.cpp Wed Nov 12 17:39:33 2008 +0900 @@ -0,0 +1,29 @@ +#include "viewerFB.h" +#include "Func.h" +#include "fb.h" + +extern void post2runLoop(void *); + +void +ViewerFB::video_init(void) +{ + Uint32 sdl_flag = default_sdl_flag | SDL_INIT_VIDEO; + //Uint32 sdl_flag = default_sdl_flag; + + if (SDL_Init(sdl_flag) < 0) { + fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError()); + exit(1); + } + + pixels = (Uint32*)get_fbdev_addr(); + + if (pixels == 0) { + pixels = (new Uint32[width*height*32/8]); + } +} + +void +ViewerFB::clean_pixels() +{ + //bzero(pixels, sizeof(int)*width*height); +}