Mercurial > hg > Game > Cerium
diff Renderer/Engine/viewerSDL.cc @ 984:dbebc7afd08e draft
minor fix
author | root@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Fri, 01 Oct 2010 01:25:45 +0900 |
parents | b662e9dd26b0 |
children | da1cec21f0c9 |
line wrap: on
line diff
--- a/Renderer/Engine/viewerSDL.cc Fri Oct 01 00:37:06 2010 +0900 +++ b/Renderer/Engine/viewerSDL.cc Fri Oct 01 01:25:45 2010 +0900 @@ -3,6 +3,8 @@ #include "TaskManager.h" #include "viewer_types.h" +#define UGA 1 + extern void post2runLoop(void *); #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK @@ -21,7 +23,7 @@ exit(1); } - screen = SDL_SetVideoMode(width, height, bpp, SDL_SWSURFACE); + screen = SDL_SetVideoMode(width, height, bpp, SDL_HWSURFACE); if (screen == NULL) { fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); SDL_Quit(); @@ -45,14 +47,28 @@ ViewerSDL::clean_pixels() { //bzero(pixels, sizeof(int)*width*height); +#if !UGA SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,0,0,0)); +#endif } void ViewerSDL::clear_screen() { +#if !UGA SDL_BlitSurface(bitmap, NULL, screen, NULL); SDL_UpdateRect(screen, 0, 0, 0, 0); +#endif +} + +uint32_t * +ViewerSDL::flip_screen(uint32_t *old) +{ +#if UGA + SDL_BlitSurface(bitmap,NULL,screen,NULL); + SDL_UpdateRect(screen,0,0,0,0); +#endif + return old; } void