Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualC0lumbo

Posted 09 December 2012 - 01:34 AM

What exactly is sprite buzzing?

Is it sprites moving a inconsistent speeds - that seems to be what most people understood from your previous post? In which case you would need to account for the frame time in order to fix it. Perhaps the reason SDL_FULLSCREEN | SDL_HWSURFACE, | SDL_DOUBLEBUF 'fixes' your problems is because vsync is also implicitly being applied. This means that your title is being automatically locked to your monitor refresh rate (probably 60hz) and so is running at a much more consistent rate. You could emulate the same effect without those flags if you limited your frame rate manually by measuring how long your frame took, then sleeping for an amount that brings your frame time up to approximately the 16.66 millisecond mark.

However, when you say sprite buzzing, do you mean that your sprites flicker, leave trails and move backwards and forwards rapidly sometimes? If that is the case, then perhaps all you're missing is a screen clear (glClear if you're using OpenGL). The fact you mention the speed of alpha blending makes me believe this could be the case.

(EDIT: In fact, it occurs to me that maybe you're deliberately skipping the screen clear in order to create a motion blur style effect. If this is the case, then unfortunately you need to use a different approach. In general you should consider the state of the frame-buffer at the start of a new frame to be full of random junk. In practise, the random junk in the frame buffer is usually an old frame, typically the one before last, but you should never assume that is reliably the case.)

#1C0lumbo

Posted 09 December 2012 - 12:58 AM

What exactly is sprite buzzing?

Is it sprites moving a inconsistent speeds - that seems to be what most people understood from your previous post? In which case you would need to account for the frame time in order to fix it. Perhaps the reason SDL_FULLSCREEN | SDL_HWSURFACE, | SDL_DOUBLEBUF 'fixes' your problems is because vsync is also implicitly being applied. This means that your title is being automatically locked to your monitor refresh rate (probably 60hz) and so is running at a much more consistent rate. You could emulate the same effect without those flags if you limited your frame rate manually by measuring how long your frame took, then sleeping for an amount that brings your frame time up to approximately the 16.66 millisecond mark.

However, when you say sprite buzzing, do you mean that your sprites flicker, leave trails and move backwards and forwards rapidly sometimes? If that is the case, then perhaps all you're missing is a screen clear (glClear if you're using OpenGL). The fact you mention the speed of alpha blending makes me believe this could be the case.

PARTNERS