diff Renderer/Engine/sgchangeFB.cc @ 692:50750b118116

add sgchangeFB,SDL
author hiroki@localhost.localdomain
date Tue, 08 Dec 2009 16:52:04 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Engine/sgchangeFB.cc	Tue Dec 08 16:52:04 2009 +0900
@@ -0,0 +1,29 @@
+#include "sgchangeFB.h"
+#include "Func.h"
+#include "fb.h"
+
+//extern void post2runLoop(void *);
+
+void
+SgChangeFB::video_init(TaskManager *manager)
+{
+    Uint32 sdl_flag = default_sdl_flag | SDL_INIT_VIDEO;
+
+    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
+SgChangeFB::clean_pixels()
+{
+    //bzero(pixels, sizeof(int)*width*height);
+    //memset(pixels, 0xFF, sizeof(int)*width*height);
+}