Mercurial > hg > Game > Cerium
diff Renderer/Engine/viewerSDL.cc @ 728:c7afc21e448d draft
add Engine/ViewerDevice , SgRootChange not work
author | aaa |
---|---|
date | Sat, 19 Dec 2009 20:32:02 +0900 |
parents | 3bc98f6d31ff |
children | b662e9dd26b0 |
line wrap: on
line diff
--- a/Renderer/Engine/viewerSDL.cc Sat Dec 19 17:11:43 2009 +0900 +++ b/Renderer/Engine/viewerSDL.cc Sat Dec 19 20:32:02 2009 +0900 @@ -1,13 +1,17 @@ #include "viewerSDL.h" #include "Func.h" #include "TaskManager.h" +#include "viewer_types.h" extern void post2runLoop(void *); -extern +#define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK -void -ViewerSDL::video_init(TaskManager *manager) +ViewerSDL::ViewerSDL() {} +ViewerSDL::~ViewerSDL() {} + +Uint32 * +ViewerSDL::video_init(TaskManager *manager, int bpp, int width, int height) { Uint32 sdl_flag = default_sdl_flag | SDL_INIT_VIDEO; Uint32 *p; @@ -31,7 +35,7 @@ screen->pitch, redMask, greenMask, blueMask, alphaMask); - pixels = p; + return p; } void @@ -42,19 +46,15 @@ } void -ViewerSDL::run_loop(HTaskPtr task_next) +ViewerSDL::clear_screen() { SDL_BlitSurface(bitmap, NULL, screen, NULL); SDL_UpdateRect(screen, 0, 0, 0, 0); - - Viewer::run_loop(task_next); } void -ViewerSDL::run_finish() +ViewerSDL::free_device() { free(bitmap->pixels); SDL_FreeSurface(bitmap); - - Viewer::run_finish(); }