hi, i am currently doing some fullscreen animation and have noticed some
flickering only in the region of a blit from one surface to another. It
doesn’t occur, or is at least not noticeable in a window. has anyone come
across this before? or know of possible reasons/fixes?
–Keith
Are you using SDL_HWSURFACE without using SDL_DOUBLEBUF? Unless you
sync (somehow) with the verticle retrace, you will get tearing… Also,
even if you do v-sync, if you blit a non-final image (a multiple layer
image for instance that is not pre-composited) you will get a flicker…
the best solution is to either:
1) pre composite all layers to an off-screen buffer, and use some dirty
rect system to blit the composited image to the screen… (you still
need to account for the v-sync somehow)
or
2) use SDL_DOUBLEBUF, and SDL_Flip() when you are done drawing each
frame… (this will probably work the best)…
-LorenOn Thu, 2002-10-03 at 10:01, Keith Swyer wrote:
hi, i am currently doing some fullscreen animation and have noticed some
flickering only in the region of a blit from one surface to another. It
doesn’t occur, or is at least not noticeable in a window. has anyone come
across this before? or know of possible reasons/fixes?
–Keith
no, i was just using the SDL_HWSURFACE. I gonig to try thr SDL_DOUBLEBUF,
however i am not 100% sure how to use it correctly. Do i just call flip
after i blit each screen? or does it do the blit ? or do i call it before
the blit? or to i have to keep track of two different surfaces, drawing the
new image to the surface not seen, then blit it calling sdl_flip?
Are you using SDL_HWSURFACE without using SDL_DOUBLEBUF? Unless you
sync (somehow) with the verticle retrace, you will get tearing… Also,
even if you do v-sync, if you blit a non-final image (a multiple layer
image for instance that is not pre-composited) you will get a flicker…
the best solution is to either:
- pre composite all layers to an off-screen buffer, and use some dirty
rect system to blit the composited image to the screen… (you still
need to account for the v-sync somehow)
or
- use SDL_DOUBLEBUF, and SDL_Flip() when you are done drawing each
frame… (this will probably work the best)…
-Loren
hi, i am currently doing some fullscreen animation and have noticed some
flickering only in the region of a blit from one surface to another. It
doesn’t occur, or is at least not noticeable in a window. has anyone
come> On Thu, 2002-10-03 at 10:01, Keith Swyer wrote:
across this before? or know of possible reasons/fixes?
–Keith
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
before each frame update (or flip) you do all the requied blitting with no
updateRect()s at all, then you call SDL_Flip(). you only have to deal with
one surface:
SDL_Surface *screen;
screen = SDL_SetVideoMode( width, height, bpp, SDL_HWSURFACE|SDL_DOUBLEBUF|
OTHER_FLAGS );
while( some_condition ) {
do all the blitting you want onto the screen surface
you might want to wait a short period to keep a constant frame rate
SDL_Flip( screen );
}
Hope this helps,
Mahmoud Al Gammal>no, i was just using the SDL_HWSURFACE. I gonig to try thr SDL_DOUBLEBUF,
however i am not 100% sure how to use it correctly. Do i just call flip
after i blit each screen? or does it do the blit ? or do i call it before
the blit? or to i have to keep track of two different surfaces, drawing the
new image to the surface not seen, then blit it calling sdl_flip?
Are you using SDL_HWSURFACE without using SDL_DOUBLEBUF? Unless you
sync (somehow) with the verticle retrace, you will get tearing… Also,
even if you do v-sync, if you blit a non-final image (a multiple layer
image for instance that is not pre-composited) you will get a flicker…
the best solution is to either:
- pre composite all layers to an off-screen buffer, and use some dirty
rect system to blit the composited image to the screen… (you still
need to account for the v-sync somehow)
or
- use SDL_DOUBLEBUF, and SDL_Flip() when you are done drawing each
frame… (this will probably work the best)…
-Loren
On Thu, 2002-10-03 at 10:01, Keith Swyer wrote:
hi, i am currently doing some fullscreen animation and have noticed some
flickering only in the region of a blit from one surface to another. It
doesn’t occur, or is at least not noticeable in a window. has anyone
come
across this before? or know of possible reasons/fixes?
–Keith
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl