109
|
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(void)
|
|
9 {
|
|
10 Uint32 sdl_flag = default_sdl_flag | SDL_INIT_VIDEO;
|
|
11 //Uint32 sdl_flag = default_sdl_flag;
|
|
12
|
|
13 if (SDL_Init(sdl_flag) < 0) {
|
|
14 fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError());
|
|
15 exit(1);
|
|
16 }
|
|
17
|
|
18 pixels = (Uint32*)get_fbdev_addr();
|
|
19
|
|
20 if (pixels == 0) {
|
|
21 pixels = (new Uint32[width*height*32/8]);
|
|
22 }
|
|
23 }
|
|
24
|
|
25 void
|
|
26 ViewerFB::clean_pixels()
|
|
27 {
|
|
28 //bzero(pixels, sizeof(int)*width*height);
|
|
29 }
|