X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Facesskernel_src%2Fui_sdl.c;h=520ac0091dd23f74a654a8589d7a99889bb47a28;hb=cfe6a9f2a126cc26ac74d5454e8378bd1193fcf8;hp=9f46356853f36aafd71cfcba50694f89ea56dc2e;hpb=c84c6acf1e8be4fb6e76ef0f8fd275400be8d5ae;p=tpg%2Facess2.git diff --git a/AcessNative/acesskernel_src/ui_sdl.c b/AcessNative/acesskernel_src/ui_sdl.c index 9f463568..520ac009 100644 --- a/AcessNative/acesskernel_src/ui_sdl.c +++ b/AcessNative/acesskernel_src/ui_sdl.c @@ -38,7 +38,7 @@ int UI_Initialise(int MaxWidth, int MaxHeight) // Set up video SDL_Init(SDL_INIT_VIDEO); printf("UI attempting %ix%i %ibpp\n", giUI_Width, giUI_Height, 32); - gScreen = SDL_SetVideoMode(giUI_Width, giUI_Height, 32, 0); + gScreen = SDL_SetVideoMode(giUI_Width, giUI_Height, 32, SDL_DOUBLEBUF); if( !gScreen ) { fprintf(stderr, "Couldn't set %ix%i video mode: %s\n", giUI_Width, giUI_Height, SDL_GetError()); SDL_Quit(); @@ -146,7 +146,12 @@ void UI_MainLoop(void) gUI_KeyboardCallback(KEY_ACTION_RELEASE|acess_sym); } break; - + + case SDL_USEREVENT: + SDL_UpdateRect(gScreen, 0, 0, giUI_Width, giUI_Height); + SDL_Flip(gScreen); + break; + default: break; } @@ -202,5 +207,13 @@ void UI_FillBitmap(int X, int Y, int W, int H, Uint32 Value) void UI_Redraw(void) { // TODO: Keep track of changed rectangle - SDL_UpdateRect(gScreen, 0, 0, giUI_Width, giUI_Height); +// SDL_UpdateRect(gScreen, 0, 0, giUI_Width, giUI_Height); + SDL_Event e; + + e.type = SDL_USEREVENT; + e.user.code = 0; + e.user.data1 = 0; + e.user.data2 = 0; + + SDL_PushEvent( &e ); }