On Mon, Jan 04, 2010 at 10:00:14AM +0000, guest wrote:
> I have already tried the custom event loop . I added these lines after
> AG_BeginRendering(); to display my syrface at the background
> 
> .....
> 
> /* Render GUI elements */
> AG_BeginRendering();
> 
> /*****mycode******/
>    DrawMySurface();
>    SDL_BlitSurface(mySurface, NULL, agView->v, NULL); 
>    SDL_UpdateRect(agView->v, 0, 0, width, height); 
> /* if i use this SDL_UpdateRect or SDL_Flip() the surface is shown at screen 
> but
> every open agar window "flickers" */ 
> 
> /*****end om my code*****/
> 
> AG_TAILQ_FOREACH(win, &agView->windows, windows) {
> AG_ObjectLock(win);
> AG_WindowDraw(win);
> AG_ObjectUnlock(win);
> }
> ..... (etc)
> 
> 
> if i use SDL_UpdateRect() or SDL_Flip()i can see my surface but every open 
> agar
> window "flickers". Is there a way to avoid this ?

Instead of calling SDL_UpdateRect() directly in your code, use
AG_ViewUpdateFB(). This will cause your rectangles to be updated by
the SDL_UpdateRects() call in AG_EndRendering().

_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to