Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

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

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 ibuki917   Members   


Posted 08 December 2012 - 10:33 PM

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)'

#2 ptrrf   Members   


Posted 08 December 2012 - 11:20 PM

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.

#3 C0lumbo   Members   


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.

(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, 09 December 2012 - 01:34 AM.

#4 ptrrf   Members   


Posted 09 December 2012 - 02:29 AM

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.

#5 uglybdavis   Members   


Posted 10 December 2012 - 05:31 PM

I guess my question would be, why are you trying to avoid using a frame delta?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.