May 07, 2024, 07:10:53 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Double Buffer?

Started by Swos2008, June 11, 2008, 12:57:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Swos2008

Hiya all,

I am new to this forum.

I was making Sprites move around the screen with Cls but I have notice that there loads of Sprites in the background when I move the sprites.
I have put Cls inside the loop to clean the screen but it wont do it....

I thought Double Buffer would do the trick but what the commands for that please?

cheers  :)

aurelCB

CLS is command for console.
Look in example smashout.eba

Swos2008

Hiya all,

I have been told to look the example of SMASHOUT where show how to do DOUBLE BUFFER. When I run the program in Dual core( E6750 ) and you will see the STRANGE picture that I have CAPTURE!

It already got DOUBLE BUFFER in SMASHOUT but still...why it is so JERKY?

http://img65.imageshack.us/my.php?image=whyxg8.png


Barney

What frame rate are you using on your monitor? The game is set to work with 75 Hz and it may be jerky if run under different frame rate? Check these lines in the code:

'target 75 frames per second for ball movement.
mElapsed = timeGetTime() - mTimer
mTimer = timeGetTime()
mAdjust = mElapsed / 13.3333
fps = FLIP 1
'mAdjust = 1


The important line is:

mAdjust=mElapsed / 13.3333

Change constant 13.3333 to whatever is needed for your system. For example, if your system's frame rate is 60 Hz (standard for LCD monitors) the constant should be 16.6666 so the line becomes:

mAdjust=mElapsed / 16.6666

Barney

Swos2008

June 12, 2008, 03:57:41 PM #4 Last Edit: June 12, 2008, 04:02:54 PM by Swos2008
My monitor Refresh rate is   1680 x 1050  60hz

I change the code on what you have said...Barney but the screen is still Jerky  ???

aurelCB

By the way my monitor is on 800x600 60Hz and program work perfectly.

Swos2008

that is strange.....so what do you think cause jerky on my system?

my system spec is

E6750

2GB RAM

GEFORCE 8800GTS 640MB

Ionic Wind Support Team

Try updating your video card drivers to the latest version, make sure you have applied all updates to your OS.  (XP, Vista?)

That example uses DirectX 7.0, which is old by todays standard, and I have seen issues with certain GeForce drivers. 

Try the other DX samples. 

Paul.
Ionic Wind Support Team

Swos2008

Hiya paul,

I have check other DX sample and they are fine apart from one Smashout sample which is causing me problem.

So far, It is my first time and I been have add background, moving Sprites and Now I gonna draw enemys sprites then learn about Type for space invader.

:)