539
|
1 #include "viewerFB.h"
|
|
2 #include "Func.h"
|
|
3 #include "fb.h"
|
|
4
|
|
5 //extern void post2runLoop(void *);
|
|
6
|
|
7 void
|
|
8 ViewerFB::video_init(TaskManager *manager)
|
|
9 {
|
|
10 Uint32 sdl_flag = default_sdl_flag | SDL_INIT_VIDEO;
|
|
11
|
|
12 if (SDL_Init(sdl_flag) < 0) {
|
|
13 fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError());
|
|
14 exit(1);
|
|
15 }
|
|
16
|
|
17 pixels = (Uint32*)get_fbdev_addr();
|
|
18
|
|
19 if (pixels == 0) {
|
|
20 pixels = (new Uint32[width*height*32/8]);
|
|
21 }
|
|
22 }
|
|
23
|
|
24 void
|
|
25 ViewerFB::clean_pixels()
|
|
26 {
|
|
27 //bzero(pixels, sizeof(int)*width*height);
|
|
28 //memset(pixels, 0xFF, sizeof(int)*width*height);
|
|
29 }
|