Jump to content
  • Advertisement
Sign in to follow this  

is threre no way to regulate 'buzzing frames' without 'delta time'?

This topic is 2168 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi. i wrote that question a few days ago.


thanks for all the person answers my question,

however, there is no way to regulate 'buzzing frames' without 'delta time'?

because, i want that if the framerate is low, game processing (ex. bullet moving) is have to slowed.

in my game, when Start Game Screen Surface with SDL_FULLSCREEN | SDL_SWSURFACE, 'sprite buzzing' occured.

however, SDL_FULLSCREEN | SDL_HWSURFACE, | SDL_DOUBLEBUF 'sprite buzzing' problems are solved.

but, there are two problems about SDL_FULLSCREEN | SDL_HWSURFACE, | SDL_DOUBLEBUF.

first. SDL_HWSURFACE | SDL_DOUBLEBUF mode are not applied when Window mode.

second, Alpha Blending is very slow when SDL_FULLSCREEN | SDL_HWSURFACE, | SDL_DOUBLEBUF.

so, my question is..

1. is there no way to regulate 'buzzing frames' without 'delta time'?

2. how to enable 'SDL_HWSURFACE | SDL_DOUBLEBUF' in window mode?

3. why the alpha blendings are slowed when 'SDL_HWSURFACE | SDL_DOUBLEBUF' are enabled?? how to solve this??

my development environment is ms windows 7, ms visual studio 2010,
sdl 1.2 and 'sdl_putenv(sdl_videodriver=directx)'

Share this post

Link to post
Share on other sites
1) I think not.

2) How did you checked if the flags SDL_HWSURFACE and SDL_DOUBLEBUF were applied? I always used those flags together and never got the "sprites buzzing" problem.

3) Post the code that apply alpha blending to the images, then I can try help you.

Share this post

Link to post
Share on other sites
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.) Edited by C0lumbo

Share this post

Link to post
Share on other sites
The thing what I know as sprite buzzing is the sprite moving backwards and forwards rapidly for a moment, but I only notice it when I'm using primitive images.
It's hard to notice it when you are using sprites and the application screen is setted to resolutions bigger than 800x600.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!