annotate TaskManager/Test/test_render/viewerFB.cpp @ 131:805d27efafd8

fix
author gongo@charles.cr.ie.u-ryukyu.ac.jp
date Tue, 25 Nov 2008 17:24:18 +0900
parents 5c194c71eca8
children 10ad99550ee8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include "viewerFB.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include "Func.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include "fb.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 extern void post2runLoop(void *);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 void
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 ViewerFB::video_init(void)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 Uint32 sdl_flag = default_sdl_flag | SDL_INIT_VIDEO;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 //Uint32 sdl_flag = default_sdl_flag;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 if (SDL_Init(sdl_flag) < 0) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError());
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 exit(1);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 pixels = (Uint32*)get_fbdev_addr();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 if (pixels == 0) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 pixels = (new Uint32[width*height*32/8]);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25 void
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26 ViewerFB::clean_pixels()
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28 //bzero(pixels, sizeof(int)*width*height);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
29 }