539
|
1 #include "viewerFB.h"
|
|
2 #include "fb.h"
|
|
3
|
728
|
4 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK
|
539
|
5 //extern void post2runLoop(void *);
|
728
|
6 ViewerFB::ViewerFB() {}
|
|
7 ViewerFB::~ViewerFB() {}
|
539
|
8
|
728
|
9 Uint32 *
|
|
10 ViewerFB::video_init(TaskManager *manager, int bpp, int width, int height)
|
539
|
11 {
|
|
12 Uint32 sdl_flag = default_sdl_flag | SDL_INIT_VIDEO;
|
|
13
|
|
14 if (SDL_Init(sdl_flag) < 0) {
|
|
15 fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError());
|
|
16 exit(1);
|
|
17 }
|
|
18
|
728
|
19 Uint32 *pixels = (Uint32*)get_fbdev_addr();
|
539
|
20
|
|
21 if (pixels == 0) {
|
728
|
22 pixels = (new Uint32[width*height*32/8]);
|
539
|
23 }
|
728
|
24
|
|
25 return pixels;
|
539
|
26 }
|
|
27
|
|
28 void
|
|
29 ViewerFB::clean_pixels()
|
|
30 {
|
|
31 //bzero(pixels, sizeof(int)*width*height);
|
|
32 //memset(pixels, 0xFF, sizeof(int)*width*height);
|
|
33 }
|
728
|
34
|
|
35 void
|
|
36 ViewerFB::clear_screen()
|
|
37 {
|
|
38 }
|
|
39
|
|
40
|
|
41 void
|
|
42 ViewerFB::free_device()
|
|
43 {
|
|
44 }
|
|
45
|
|
46
|