*
* *
*
scene.org
Log in:
login for 1 year
No account? register here

Scene.org is hosted and supported by:
Scene.org is sponsored by:
* forum - #coders

*
Topic:  Demo Coding with Dev-C++ and SDL
* Posted by scrapheap Thursday 13 October 2005 - 16:20 
I am just starting out learning to code demos in SDL. I am concentrating on learning 2D effects first of all and then once I have done some demos with them and I understand them I will move on to openGL.

The problem I am having at the minute is that as soon as I try to do anything at the pixel level (Like a lot of 2D effects need to do) I find that the frame rate drops. Does anyone know of any methods to keep the frame rate up when dealing with drawing pixels.

I am experimenting with using a large array that I draw all my effects to and then only when I want to draw to the screen do I then draw the pixels to the screen (And yes I only draw those pixels that have changed since the last frame).

* Posted by psenough Thursday 13 October 2005 - 19:48 
im not exactly an expert but the obvious must be said:

keep videomem writting loops to utmost efficiency, write to them sequently, meaning dont jump around lines and blocks, write the whole 640x480 in one dump from 0 to 640*480.. trust the cache. don't optimize where you can't measure the results (you might very easily be degrading it instead of increasing the speed if you're no expert)

some links that someone gave me a few months back: (keops or gargaj or knos, dunno anymore..)

http://www.eventhelix.com/RealtimeMantra/Basics/OptimizingCA ndCPPCode.htm
http://www.azillionmonkeys.com/qed/optimize.html
assembler optimizing tricks - http://www.agner.org/assem/

* Posted by scrapheap Friday 14 October 2005 - 10:15 
Thanks. Those sites are userful.

I have already made a few improvements but I am always looking for more ways to improve the performance.

*