Hello fellow coders!

At couple weeks a go I desided to create quickly a little Asteroids clone by using only Window GDI functions just for own fun.

But after a couple try I did not achieve as good framerates I liked to so, I begun to study why's that.

I stripped all extra away and start examining basic things of a game. My Window class was all good, my GameTimer class was also good, so it have to be the backbuffer blitting which slows down.

First I created a compatible DC and selected compatible bitmap to that. Performance was fairly good on my laptop, BUT my four year old AMD showed me the real situation. Framerate sucked. But not only the rate (which was something near 60fps) also the movement of the Shuttle (polygon) was jerky which it wasn't on laptop (which achieved 400fps).

I chanced my Backbuffer to TBitmap and voil?°. Almost 4000 fps on laptop and 1000 on my gran-ol'-amd machine.

I tried to study what makes TBitmap so fast to blit (with bitblt). I noticed that it uses device indepented bitmap, so I decided to create one my own with GDI function.

After a while I learned the use of CreateDIBSection. Performance was littlebit better than with CreateCompatibleBitmap, but when compared to TBitmap it still sucked (something like 300fps). And still the graphics with that own DIB was jerky on my gran-ol'-amd machine.

And since then I have been studying-trying-testing-creating-implementing-and-you-name-whatever the creation and blitting of DIB but I still can't get more than 300fps no matter how I create DIB or blit it (StrechDIBits, BitBlt and etc.)

I have even found articles and examples how to tune performance of DIBS (here's the Microsofts own article http://support.microsoft.com/kb/230492) but there's still no go.

Ofcourse I could use TBitmap on my backbuffer that's no problem at all, but I'm pondering why I can't achieve same speed with my own created backbuffers.

Does anyone have an clue or idea because I'm out?!?

I still liked to do my little game by just using Windows GDI functions for drawing.

ps. sorry my bad, bad, bad and poor english.


edit: this 'project' continues on here:
http://www.pascalgamedevelopment.com...p?topic=5967.0